首先字义二维数组A[M][N],
函数如下:
main()
{
int i,j,Temp;
/*定义并初始化二维数组*/
int A[M][N]={{.......},{......},....{......}};
/*转置*/
for(i=0;i
{
Temp=Array[i][j];
Array[i][j]=Array[j][i];
Array[j][i]=Temp;
}
}
#include
#define N 4
void main()
{ int a[N][N]={{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}};
int m,i,j;
for(i=0; i
printf("\n");
}
}