这是我的代码:
int main(void)
{
int i, j, k, n;
char userLatter, space;
printf("please enter an uppercase letter:\n");
scanf("%c", &userLatter);
n = 9;
for (i = 0; i < 5; i++)
{
space = ' ';
for (j = 5; j > i; j--)
{
++space;
}
for (k = 0; k <= i ; k += 1)
{
printf("%c%c%c", space, userLatter, space);
}
printf("\n");
}
}
你能告诉我我应该怎么做才能打印空格字符吗?
谢谢!