#include<iostream> using namespace std; const int MAXN=25; int jz[MAXN][MAXN]; int main() { int n; while(cin>>n){ for(int i=0;i<n;++i) for(int j=0;j<n;++j) cin>>a[i][j]; for(int i=0;i<n;++i){ for(int j=0;j<n;++j){ cout<<a[j][i]; if(j!=n-1)cout<<" "; } cout<<endl; } } return 0; } /* Main.cc: In function 'int main()': Main.cc:11:14: error: 'a' was not declared in this scope cin>>a[i][j]; ^ Main.cc:9:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation] for(int i=0;i<n;++i) ^~~ Main.cc:13:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for' for(int i=0;i<n;++i){ ^~~ Main.cc:15:17: error: 'a' was not declared in this scope cout<<a[j][i]; ^ */ |
Double click to view unformatted code.