题解 | #字符圣诞树#
字符圣诞树
https://www.nowcoder.com/practice/0fae60c3b5c64699b7c0f031c2187dde
#include <stdio.h> int main() { //输入字符 char ch=0; ch=getchar(); int i=0; for(i=0;i<5;i++) { int j=0;//空格 for(j=0;j<4-i;j++) { printf(" "); } //字符 for(j=0;j<=i;j++) { printf("%c ",ch); } printf("\n"); } return 0; }