请大佬帮忙看下,为什么输出一样,却没分
查看原帖
请大佬帮忙看下,为什么输出一样,却没分
1359774
tryagain001楼主2024/6/23 19:24
#include<iostream>

#include

using namespace std;

int main()

{

int a,b,c=1;

cin>>a;

for(int i=1;i<=a;i++)

{

    for(int j=0;j<a;j++)

    {

        b++;

        if(b>9)

        {

            cout<<b;

        }

        else

        {

            cout<<"0"<<b;

        }

    }

    cout<<'\n';

}

cout<<'\n';

for(int i2=a;i2>0;i2--)

{

    for(int j2=1;j2<=a;j2++)

    {

        if(j2>=i2)

        {

            if(c>9)

            {

                cout<<c;

            }

            else

            {

                cout<<"0"<<c;

            }

            c++;

        }

        else

        {

            cout<<"  ";   

        }

    }

    cout<<'\n';

}

return 0;

}

2024/6/23 19:24
加载中...