文章
55
粉丝
100
获赞
12
访问
31.0k
#include <iostream>
#include <vector>
#include<string>
#include<algorithm>
using namespace std;
int arr[100][100] = {0};
int main(){
int n;
while(cin>>n){
for(int i = 0; i<n; i++){
for(int j = 0; j<n; j++){
cin>>arr[i][j];
}
}
for(int i = 0; i<n; i++){
for(int j = 0; j<i; j++){
int temp = arr[i][j];
arr[i][j] = arr[j][i];
arr[j][i] = temp;
}
}
for(int i = 0; i<n; i++){
for(int j = 0; j<n; j++){
cout<<arr[i][j]<<" ";
}
cout<<endl;
}
}
}
登录后发布评论
暂无评论,来抢沙发