编辑代码

#include <stdio.h>
int main () {
    int i,j;
    char a, b;
    printf("Enter your capital letter:");
    scanf("%c",&a);
    // printf("%c",a);

    int r = a-'A';
    // printf("%i",r);

    for (i=0;i<=r;i++){
        for (j=i; j<r; j++){
            printf(" ");
        }
        for (j=r-i, b='A'; j<=r; j++,b++){
            printf("%c",b);
        }
        for (j=r-i, b=a-j-1; j<r; j++,b--){
            printf("%c",b);
        }
        printf("\n");

    }
    
}