字母倒三角

#include<stdio.h>

int main()
{
    char c='A';
    char temp;
    int n;
    scanf("%d",&n);
    int i;
    int j;
    for(i=0;i<n;i++){
        for(j=0;j<n-i;j++){
            printf("%c",c);
            temp=((c+1)-'A')%26+'A';
            c=temp;
        }
        printf("\n");
    }
}

输出样例:
在这里插入图片描述

发布了9 篇原创文章 · 获赞 1 · 访问量 246

猜你喜欢

转载自blog.csdn.net/howoldareyougg/article/details/105749898
今日推荐