根据问题写出一个程序

编写一个带有嵌套for语句的程序,以显示如下模式。
A.
BB
CCC
DDDD
提示:
(1) 外环数为打印行数;
(2) 内环数是每行打印的字母数,这个数字与外环的循环变量之间的关系是什么?
(3) 字母变化的规则是什么?
Write a program with nested for statements to display a pattern as follows.
A
BB
CCC
DDDD
Hint:
(1) The number of outer loop is the number of printed rows;
(2) The number of inner loop is the number of printed letters on each row, and what is the relationship between this number and the loop variable of the outer loop?
(3) What are the rules of the change of letters?

#include<stdio.h>
#include<ctype.h>
int main()
{
    int i,N,j;
    char c;
    printf("请输入打印层数:\n");
    scanf("%d",&N);
    printf("请输入起始字符:\n");
    getchar();
    scanf("%c",&c);
    for(i=1;i<=N;i++)
    {
        for(j=1;j<=i;j++)
            printf("%c",c);
        if(isalpha(c+1))
            c+=1;
        else
        {
            if(isupper(c))
                c='A';
            else
                c='a';
        }
        printf("\n");
    }
    return 0;
}

直接使用两个for循环

#include<stdio.h>
int main()
{
    int i,j;
    char c='A';
    for(i=0;i<4;i++)
    {
        for(j=0;j<i;j++)
            printf("%c",c);
        c++;
        printf("\n");
    }
    return 0;
}