题解 | #空心三角形图案#
空心三角形图案
http://www.nowcoder.com/practice/2ccc5fca423e47f0b622fe6f151cfab4
include<stdio.h>
int main()
{
int a = 0;
while (~scanf("%d", &a))
{
for (int b = 0; b < a; b++)
{
for (int c = 0; c < a; c++)
{
if (b == c || b == a - 1)
printf("* ");
else if (c == 0)
printf("* ");
else
printf(" ");
}printf("\n");
}
}return 0;
}