forked from k-samarth/Data-structures
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPattern_numbers_c
More file actions
48 lines (44 loc) · 807 Bytes
/
Copy pathPattern_numbers_c
File metadata and controls
48 lines (44 loc) · 807 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>
int main()
{
int n,i,j;
scanf("%d",&n);
for(i=n;i>=1;i--)
{
for(j=n;j>=1;j--)
{
if(j>i)
printf("%d ",j);
else
printf("%d ",i);
}
for(j=2;j<=n;j++)
{
if(j>i)
printf("%d ",j);
else
printf("%d ",i);
}
printf("\n");
}
//
for(i=2;i<=n;i++)
{
for(j=n;j>=1;j--)
{
if(i>j)
printf("%d ",i);
else
printf("%d ",j);
}
for(j=2;j<=n;j++)
{
if(j>i)
printf("%d ",j);
else
printf("%d ",i);
}
printf("\n");
}
return 0;
}