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