题解
2023-08-08 15:26:48
发布于:浙江
18阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int n ,m;
cin >> n >> m;
int lst[n + 1][m + 1];
for (int i = 1 ; i <= n ; i++){ //输入矩阵
for (int j = 1 ; j <= m ; j++){
cin >> lst[i][j];
}
}
for (int i = 1 ; i <= m ; i++){ //输出矩阵
for (int j = 1 ; j <= n ; j++){
cout << lst[j][i] << " "; //[i][j]变[j][i]
}
cout << "\n";
}
return 0;
}
这里空空如也
有帮助,赞一个