六道仙人吧 关注:11,369贴子:71,439

回复:大家来加我关注,加的送小吧

只看楼主收藏回复

1210题答案--LegendAlex(c++)
#include <iostream>
#include <iomanip>
using namespace std;
int a[11][11];
int main(){
int n;
int i,j;
cin>>n;
for(i=1;i<=n;i++){
for(j=1;j<=n;j++){
a[i][j]=i+(j-1)*n;
}
}
for(i=1;i<=n;i++){
for(j=1;j<=n;j++){
cout<<setw(3)<<a[i][j];
}
cout<<endl;
}
return 0;
}


IP属地:加拿大69楼2018-08-29 18:53
回复