#include <stdio.h>
#define R 3
#define C 4
int main(int argc, const char * argv[])
{
int a[R][C]={
{1,2,3,4},
{5,6,7,8},
{9,10,11,12},
};
int b[C][R];
int i,j;
printf("a为:\n");
for (i=0;i<R;i++)
{
for(j=0;j<C;j++)
{
printf("%-3d",a[i][j]);
}
printf("\n");
}
printf("aT为:\n\n");
for (i=0;i<C;i++)
{
for(j=0;j<R;j++)
{
b[i][j]=a[j][i];
}
}
for (i=0;i<C;i++)
{
for(j=0;j<R;j++)
{
printf("%-3d",b[i][j]);
}
printf("\n");
}
return 0;
}