例如,有下列矩阵:
1 2 3
4 5 6
7 8 9
10 11 12
若k为2,程序执行结果为:
7 8 9
4 5 6
1 2 3
10 11 12
请在程序的下划线处填入正确的内容并把下划线删除, 使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
#include
#define N 3
#define M 4
/**********found**********/
void fun(int (*a)[N], int __1__)
{ int i,temp ;
/**********found**********/
for(i = 0 ; i < __2__ ; i++)
{ temp=a[0][i] ;
/**********found**********/
a[0][i] = __3__ ;
a[k][i] = temp ;
}
}
main()
{ int x[M][N]={ {1,2,3},{4,5,6},{7,8,9},{10,11,12} },i,j;
printf("The array before moving:\n\n");
for(i=0; i { for(j=0; j printf("\n\n"); } fun(x,2); printf("The array after moving:\n\n"); for(i=0; i { for(j=0; j printf("\n\n"); } } 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>