题解 | #K形图案#
K形图案
http://www.nowcoder.com/practice/753cc2662d9949fe826a85f815db0ca4
include<stdio.h>
int main()
{
int a = 0;
while (~scanf("%d", &a))
{
for (int b = 0; a >= b; b++)
{
for (int c = 0; a >= c + b; c++)
{
printf("* ");
}printf("\n");
}
for (int d = 0; a > d; d++)
{
for (int e = 0; d+2 > e ; e++)
{
printf("* ");
}printf("\n");
}
}return 0;
}