#include
#define M 2
#define N 5
//int a[M][N] = { {1, 2, 3, 4, 5} , {6, 7, 8, 9, 10} , {11, 12, 13, 14, 15}};
int a[M][N] = { {1, 2, 3, 4, 5} , {6, 7, 8, 9, 10}};
int main()
{
int i = 0;
int j = 0;
int temp = 0;
for(i=0; i {
for(j=0; j {
printf("%d\t", a[i][j]);
}
printf("\n");
}
for(i=0; i {
for(j=i; j {
temp = a[i][j];
a[i][j] = a[j][i];
a[j][i] = temp;
}
}
printf("\nAfter Reverse, The Matrix is:\n");
for(i=0; i {
for(j=0; j {
printf("%d\t", a[i][j]);
}
printf("\n");
}
}
阅读(2187) | 评论(0) | 转发(0) |