我的代码哪里错了啊?

#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;

}
全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务