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