回复 10楼 azzbcc
谢谢你!
回复 12楼 wzjxzht
多谢大神指点
#include <stdio.h> #include <stdlib.h> int main(void) { int row; int spc,spcrow; int lchs,lchs2; int rchs,rchs2; int var; char chars; scanf("%c",&chars); for(row=1,lchs2=1,rchs2=0,spcrow=4;row<=5;row++,spcrow--,lchs2++,rchs2++) { //空格for for(spc=1;spc<=spcrow;spc++) printf(" "); //左字符for for(lchs=1,var=4;lchs<=lchs2;lchs++,var--) printf("%c",chars-var); var+=2; //右字符for for(rchs=1;rchs<=rchs2;rchs++,var++) printf("%c",chars-var); printf("\n"); } system("pause"); return 0; }