#include <iostream>
using namespace std;
int main(){
    int a[2][3]={{1,2,3},{4,5,6}};
    int i,j,b[3][2];
    for(j=0;j<2;j++){
        for(i=0;i<3;i++){
            cout<<a[j][i]<<" ";
            b[i][j]=a[j][i];
        }
        cout<<endl;
    }
    cout<<"array b:"<<endl;
    for(i=0;i<3;i++){
        for(j=0;j<2;j++){
            cout<<b[i][j]<<" ";
        }
        cout<<endl;
    }
    system("PAUSE");
    return 0;
}

运行结果

1 2 3
4 5 6
array b:
1 4
2 5
3 6
请按任意键继续. . .

 

相关文章:

  • 2021-05-10
  • 2021-08-26
  • 2022-02-08
  • 2022-01-30
猜你喜欢
  • 2021-11-03
  • 2021-05-04
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2021-10-28
相关资源
相似解决方案