-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy path19.c
More file actions
32 lines (29 loc) · 686 Bytes
/
Copy path19.c
File metadata and controls
32 lines (29 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
int main()
{
int i, j;
int digit = 1;
char letter = 'A';
int n;
scanf("%d", &n);
for (i = 0; i < n / 2; i++)
{
for (j = 0; j < (5 - i); j++)
printf(" ");
for (j = 1; j <= i + 1; j++)
printf("%d ", j);
for (j = j - 2; j >= 1; j--)
printf("%d ", j);
printf("\n");
}
for (i = n / 2; i >= 0; i--)
{
for (j = 0; j < (5 - i); j++)
printf(" ");
for (j = 1; j <= i + 1; j++)
printf("%d ", j);
for (j = j - 2; j >= 1; j--)
printf("%d ", j);
printf("\n");
}
}