提交时间:2019-12-15 16:38:09

运行 ID: 3306

#include<iostream> using namespace std; int main(){ int y,er=1; cin>>y; int youku[y+1][y+1]; for(int E=1;E<=y;E++){ for(int r=1;r<=y;r++){ youku[E][r]=er; er++; } } for(int E=1;E<=y*y;E++){ youku[y][y]=E; } for(int t=1;t<=y;t++){ for(int u=1;u<=y;u++){ cout<<youku[t][u]; er++; if(u!=y) cout<<" "; } cout<<endl; } return 0; }