#include <iostream>
using namespace std;
int main(){
int A[2][3]={{0,2,4},{1,3,5}},T[3][2],i,j;
for(i=0;i<2;i++)
for(j=0;j<3;j++)T[j][i]=A[i][j];//做数组 的转置
cout<<"A="<<endl;
for(i=0;i<2;i++)
{for(j=0;j<3;j++)
cout<<A[i][j]<<" ";
cout<<endl;//输出原数组
}
cout<<"T="<<endl;
for(i=0;i<3;i++){
for(j=0;j<2;j++)
cout<<T[i][j]<<" ";
cout<<endl;
}return 0;//输出转置后的数组
}
06-26
1291
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交