1 条题解

  • 0
    @ 2025-7-15 17:49:02

    #include <bits/stdc++.h> using namespace std;

    int main() { char a; int x ; cin >> a >> x; if ( a == 'Z') { for(int i = 1; i <= x; i++) { for(int j = 1; j <= x ; j++) { cout << ""; } cout << endl; } } else { for(int i = 1; i <= x; i++) { cout << setw(x - i + 1) ; for(int j = 1; j <= 2 * i - 1 ; j++) { cout << ""; } cout << endl; } for(int i = x - 1; i >= 1; i--) { cout << setw(x - i + 1) ; for(int j = 1; j <= 2 * i - 1 ; j++) { cout << "*"; } cout << endl; } }

    return 0;
    

    }

    • 1

    信息

    ID
    259
    时间
    1000ms
    内存
    64MiB
    难度
    6
    标签
    递交数
    40
    已通过
    14
    上传者