编辑代码

#include <stdio.h>
int main () 
{

    char zifu = 0;
    while(zifu <'A'|| zifu >'Z')//判断输入字符是否合法
    {
        printf("请输入字符:");
        scanf("%c",&zifu);
        //printf("kongge:%d\n",zifu);
    };
    

    int hang = zifu - 64;
    printf("hang:%d\n",hang );


    for(int i = 0;i< hang ;i++)//换行
    {
        printf("%d\n",i);
        int spaces = hang - i;
        while(spaces)
        { 
            printf(" ");
            spaces = spaces - 1 ;
        };//打印空格
        
       
        //for(int j = 0;j <2*hang+1;j++)
        //{
        //    printf("%c",j+65);
        //    
        //    if(j == 2*hang){printf("\n");};
        //}
    
    
    
    };



    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
    printf("Hello world!     - c.jsrun.net.");
    return 0;
}