#include<stdio.h>#include<ctype.h>void main(void){ char c,c1,c2,top; printf("Input a character:\n"); top=isupper(c=getchar())?'A':(islower(c)?'a':'\0'); if(top) { for(c1=top;c1<=c;++c1) { printf("%*c",40-(c1-top<<1)); for(c2=top;c2<=c1;++c2) printf("%2c",c2); for(c2=c1-1;c2>=top;--c2) printf("%2c",c2); printf("\n"); } }}

评论