竞赛讨论区 > 我的代码哪里错了啊?
头像
众里寻他千百度
发布于 2019-12-01 15:20
+ 关注

我的代码哪里错了啊?

#include<iostream>
using namespace std;
int main() {
    char n,***r />     cin>>n;
    int l=n-'A'+1;
    char temp='A';
    for(int i=0;i<l;i++){
        for(int j=1;j<=n-i;j++){
            cout<<' ';
        }
        temp='A';
        for(int k=0;k<i+1;k++){
            cout<<temp;
            temp+=1;
        }
        temp=temp-2;
        for(int k=1;k<i+1;k++){
            cout<<temp;
            temp-=1;
        }
        cout<<endl;
    }
    return 0;

}

全部评论

(0) 回帖
加载中...
话题 回帖

本文相关内容

等你来战

查看全部

热门推荐