1 条题解

  • 0
    @ 2022-11-24 16:13:59
    // zhoujingxuan
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin >> n;
        for (int i = n - 1, k = 1, p = 2 * n - 1; i >= 0; k += 2, i--, p -= 2)
        {
            for (int j = 1; j <= i; j++)
                cout << ' ';
            for (int j = 1; j <= k; j++)
                cout << '*';
            for (int j = 2; j <= n; j++)
            {
                for (int z = 1; z <= p; z++)
                    cout << ' ';
                for (int z = 1; z <= k; z++)
                    cout << '*';
            }
            cout << endl;
        }
        return 0;
    }
    
    • 1

    信息

    ID
    1030
    时间
    1000ms
    内存
    128MiB
    难度
    9
    标签
    递交数
    11
    已通过
    5
    上传者