我这到底错哪了啊!
在Dev-C++运行了不知道多少次
至少我觉得答案是对的
但是!!全部WA!!!! 气死我了!
#include <bits/stdc++.h>
using namespace std;
int main()
{
short n;
cin>>n;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cout<<setw(2)<<setfill('0')<<i*n+j+1;
}
cout<<endl;
}
cout<<endl<<endl;
int num=1;
for(int i=0;i<n;i++)
{
cout<<setw(2*n-2*i-2)<<setfill(' ')<<"";
for(int j=0;j<=i;j++)
{
cout<<setw(2)<<setfill('0')<<num++;
}
cout<<endl;
}
return 0;
}