【说明】 将一正整数序列{K1,K2,…,K9}重新排列成一个新的序列,新序列中,比K1小的数都在K1的前面(左面),比K1大的数都在K1的后面(右面),最后调用writeDat()函数的新序列输出到文件out.dat中。 在程序中已给出了10个序列,每个序列有9个正整数,并存入数组a[10][9]中,分别求出这10个新序列。 例:序列{6,8,9,1,2,5,4,7,3} 经重排后成为{3,4,5,2,1,6,8,9,7} 【函数】 #include < stdio. h > #include < conio. h > void jsValue( int a [10] [9] ) { int i,j,k,n,temp; int b[9]; for(i=0;i<10;i++) { temp=a[i] [0];k=8;n=0;for(j=8;j=0;j--) { if(temp < a[i] [j]) (1) =a[i][j]; if(temp >a[i] [j]) (2) =a[i][j]; if(temp =a[i] [j]) (3) = temp; } for(j=0;j<9;j++) a[i][j] =b[j]; } } void main( ) int a[10] [9] = {{6,8,9,1,2,5,4,7,3},{3,5,8,9,1,2,6,4,7}, {8,2,1,9,3,5,4,6,7}, {3,5,1,2,9,8,6,7,4}, {4,7,8,9,1,2,5,3,6}, {4,7,3,5,1,2,6,8,9}, {9,1,3,5,8,6,2,4,7}, {2,6,1,9,8,3,5,7,4}, {5,3,7,9,1,8,2,6,4}, {7,1,3,2,5,8,9,4,6} }; int i,j; (4) ; for(i=0;i<10;i++) { for(j=0;j<9;j++) { printf("%d",a[i] [j] ); if( (5) )printf(","); } printf(" \n" ); } getch( ); }