Skip to content

Commit 3d1d2dc

Browse files
authored
Create Pattern00027.c
1 parent 66fa18e commit 3d1d2dc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Pattern00027.c

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

0 commit comments

Comments
 (0)