从简单的开始吧。 从大到小插入排序 #include<stdio.h> int a[10] = { 23,423,54,45,54,534,65,132,435,756 }; void InsertionSort( int [], int ); int main(void) { int length = sizeof(a)/sizeof(int); InsertionSort( a, length ); int i; for( i = 0; i < length; ++i ) { printf("%d/n", a[i]); } return 0; } void InsertionSort( int a[], int n ) { int i; for( i = 1; i < n; ++i ) { int key = a[i]; int j = i-1; while( ( a[j] < key )&&( j > -1 ) ) { a[j + 1] = a[j]; --j; } a[j + 1] = key; } }