#includeint cmp(const void *a,const void *b); int main(void) { int num[]={10,2,4,1,4,6,7}; for(int i=0;i < sizeof(num)/4;i++) { printf("%d,",num[i]); } printf("n---------------n"); qsort(num,sizeof(num)/4,sizeof(num[0]),cmp); for(int i=0;i < sizeof(num)/4; i++) { printf("%d,",num[i]); } printf("n"); return 0; } int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }