Saleh127

cf 118b

Jul 25th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9. ll a,c,d,e,f,i,j,k=0,l;
  10. cin>>a;
  11. l=2*a;
  12. d=-1,e=-1;
  13. for(i=0; i<(2*a)+1; i++)
  14. {
  15. if(i>a) d--,e--;
  16. else d++,e++;
  17. for(int m=0; m<l; m++)
  18. {
  19. cout<<" ";
  20. }
  21. if(i<a) l-=2;
  22. else l+=2;
  23. k=0;
  24. for(j=0; j<(2*e)+1; j++)
  25. {
  26.  
  27. cout<<k;
  28. if(j<(2*e)) cout<<" ";
  29. if(j<d) k++;
  30. else k--;
  31. }
  32. cout<<endl;
  33. }
  34.  
  35.  
  36. return 0;
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment