2 条题解

  • 1
    @ 2023-5-2 12:39:08
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n,b;
        cin>>n;
        b=n;
        for(int i=1;i<=n;i++)
        {
            cout<<"**";
            for(int j=1;j<=b;j++)
            {
                cout<<" ";
            }
            for(int j=1;j<=b;j++)
            {
                cout<<"*";
            }
            b--;
            cout<<endl;
        }
         cout<<"***"<<endl;
        b=1;
        for(int i=1;i<=n;i++)
        {
            cout<<"**";
            for(int j=1;j<=b;j++)
            {
                cout<<" ";
            }
            for(int j=1;j<=b;j++)
            {
                cout<<"*";
            }
            b++;
            cout<<endl;
        }
        return 0;
    }//已AC
    
    • 0
      @ 2023-10-15 14:20:28

      输入25后:

      **                         *************************
      **                        ************************
      **                       ***********************
      **                      **********************
      **                     *********************
      **                    ********************
      **                   *******************
      **                  ******************
      **                 *****************
      **                ****************
      **               ***************
      **              **************
      **             *************
      **            ************
      **           ***********
      **          **********
      **         *********
      **        ********
      **       *******
      **      ******
      **     *****
      **    ****
      **   ***
      **  **
      ** *
      ***
      ** *
      **  **
      **   ***
      **    ****
      **     *****
      **      ******
      **       *******
      **        ********
      **         *********
      **          **********
      **           ***********
      **            ************
      **             *************
      **              **************
      **               ***************
      **                ****************
      **                 *****************
      **                  ******************
      **                   *******************
      **                    ********************
      **                     *********************
      **                      **********************
      **                       ***********************
      **                        ************************
      **                         *************************
      

      ?!

      • 1

      信息

      ID
      1977
      时间
      1000ms
      内存
      256MiB
      难度
      5
      标签
      (无)
      递交数
      956
      已通过
      400
      上传者