Skip to content

Commit 0035191

Browse files
authored
Create Pattern00011.c
1 parent 378e76d commit 0035191

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Pattern00011.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
3+
*
4+
* *
5+
* * *
6+
* * * *
7+
* * * * *
8+
9+
*/
10+
11+
#include <stdio.h>
12+
int main()
13+
{
14+
int i, j, k;
15+
for (i = 1; i <= 5; i++)
16+
{
17+
k = 1;
18+
for (j = 1; j <= 9; j++)
19+
{
20+
if (j >= 6 - i && j <= 4 + i && k)
21+
{
22+
printf("*");
23+
k = 0;
24+
}
25+
else
26+
{
27+
printf(" ");
28+
k = 1;
29+
}
30+
}
31+
printf("\n");
32+
}
33+
}

0 commit comments

Comments
 (0)