全部评论 8

  • 这才是正确的!!!!!!!!!!!!!!!

    #include<bits/stdc++.h>
    using namespace std;
    
    int main(){
        int n;
        char c;
        cin >> n >> c;
        for(int i = 1; i <= 2 * n - 1; i++){
            int dis = min(i, 2 * n - i);
            for(int j = 1; j <= n - dis; j++){
                cout << " ";
            }
            for(int j = 1; j <= 2 * dis - 1; j++){
                if(j == 1 || j == 2 * dis - 1){
                    cout << c;
                }else{
                    cout << " ";
                }
            }
            cout << endl;
        }
        return 0;
    }
    

    2026-06-26 来自 四川

    3
  • 说一下,这题题解给错了。
    正确的是:

    #include<bits/stdc++.h>
    using namespace std;
    
    int main(){
        int n;
        char c;
        cin >> n >> c;
        for(int i = 1; i <= 2 * n - 1; i++){
            int dis = min(i, 2 * n - i);
            for(int j = 1; j <= n - dis; j++){
                cout << " ";
            }
            for(int j = 1; j <= 2 * dis - 1; j++){
                if(j == 1 || j == 2 * dis - 1){
                    cout << c;
                }else{
                    cout << " ";
                }
            }
            cout << endl;
        }
        return 0;
    }
    

    2026-09-16 来自 浙江

    0
  • 不是?!错的还有那么多粉丝???

    2026-09-16 来自 浙江

    0
  • 编译错误: /code/judger/test/2100108965851725824/main.cpp: In function 'int main()':
    /code/judger/test/2100108965851725824/main.cpp:17:9: error: expected '}' at end of input
    17 | }
    | ^
    /code/judger/test/2100108965851725824/main.cpp:7:26: note: to match this '{'
    7 | for(int i=1;i<=n;i++){
    | ^
    /code/judger/test/2100108965851725824/main.cpp:17:9: error: expected '}' at end of input
    17 | }
    | ^
    /code/judger/test/2100108965851725824/main.cpp:3:11: note: to match this '{'
    3 | int main(){
    | ^

    2026-09-16 来自 浙江

    0
  • 错的

    2026-05-05 来自 广东

    0
  • 显示错误

    2026-05-03 来自 浙江

    0
  • 我要当你的粉丝!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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