为何0分?
查看原帖
为何0分?
857849
sk_007楼主2023/7/18 10:06
#include<iostream>
using namespace std;
int main()
{
    int n,k=1;
    cin>>n;
    for(int p;p<=n;p++)
    {
        for(int i=1;i<=n;i++)
        {
            if(k<10) cout<<"0"<<k;
               else cout<<k;
            k++;
        }
        cout<<endl;
    }
    k=1;
    for(int i;i<=n;i++)
    {
        for(int y=1;y<=n*2;y++)
        {
            if(y<=(n-i)*2) cout<<" ";
            else if(k<10) {cout<<"0"<<k;k++;}
               else {cout<<k;k++;}
    	}
    	cout <<endl;
    }
    return 0;
}```
2023/7/18 10:06
加载中...