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