Newer
Older
langC_sp01 / less_izon / sort.c
@Motoki Motoki 9 days ago 314 bytes first commit
//-------------------------------------------------------
//â—Žsort.c

void sort(int data[], int size) {
  int x;
  int i, j;
  for( i = 0; i < size; i += 1) {
    x = data[i];
    j = i;
    while((data[j-1] > x) && (j > 0)) {
      data[j] = data[j-1];
      j = j-1;
    }
    data[j]=x;	
  } 
} // end of sort