forked from pankaj443/CODEFORCES
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path118B.cpp
More file actions
47 lines (47 loc) · 887 Bytes
/
118B.cpp
File metadata and controls
47 lines (47 loc) · 887 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
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1<<20;
vector<int>v;
ll cnt,a[N],b[N],has[N],n,m,sum,min1,max1;
string s,t;
bool flag;
int main()
{
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
cin>>n;
for(int i=0;i<=n;i++)
{
for(int k=2*(n-i);k>0;k--)
cout<<" ";
for(int j=0;j<i;j++)
cout<<j<<" ";
for(int k=i;k>=0;k--)
{if(k==0)
{
cout<<k;
break;
}
cout<<k<<" ";
}
cout<<endl;
}
for(int i=1;i<=n;i++)
{
for(int k=2*i;k>0;k--)
cout<<" ";
for(int j=0;j<n-i;j++)
cout<<j<<" ";
for(int k=n-i;k>=0;k--)
{if(k==0)
{
cout<<k;
break;
}
cout<<k<<" ";
}
cout<<endl;
}
return 0;
}
//_4_4_3_//