#include<iostream> using namespace std; int main(){ int N; cin>>N; int k[N][N]; int w[N][N]; for(int i=0;i<N;i++){ for(int j=0;j<N;j++){ cin>>k[i][j]; w[j][i]=k[i][j]; } //cout<<"\n"; } for(int i=0;i<N;i++){ for(int j=0;j<N;j++){ cout<<w[i][j]; if(j<N){ cout<<" "; } } if(i<N){ cout<<"\n"; } } } |
Double click to view unformatted code.