表示没有错,但结果,不对,帮忙看看。。。
程序代码:
//10个数排序 #include < stdio.h > #include < stdlib.h > int main ( void ) { int i, j,a[10],temp; for ( i = 0; i<10; i++ ) scanf ( "%d",&a[i] ); for ( i = 0; i < 10; i++ ) { for ( j = 1; j < 10; j++ ) { if ( a[i] < a[j] ) { temp = a[i]; a[i] = a[j]; a[j] = temp; } } } printf ( "%5d", a[i] ); system ( "pause" ); }