#include<stdio.h>
int main(){
int M,N,m,n,a[10][10];
scanf("%d %d",&M,&N);
printf("Before:\n");
for(m=0;m<M;m++){
for(n=0;n<N;n++){
scanf("%d",&a[m][n]);
printf("%4d",a[m][n]);
}
printf("\n");
}
printf("After:\n");
for(n=0;n<N;n++){
for(m=0;m<M;m++){
printf("%4d",a[m][n]);
}
printf("\n");
}
return 0;
}
12-11
877
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-08
3012
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-16
2237
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)