Advertisement
Vl4d_Cr15714n

Untitled

Feb 17th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n;
  8. cin>>n;
  9. for(int i=1; i<=n; i++)
  10. {
  11. for(int j=1; j<=n-i; j++)
  12. {
  13. cout<<" ";
  14. }
  15. for(int j=1; j<=2*i-1; j++)
  16. {
  17. cout<<i;
  18. }
  19. cout<<endl;
  20. }
  21. for(int i=n-1; i>=1; i--)
  22. {
  23. for(int j=1; j<=n-i; j++)
  24. {
  25. cout<<" ";
  26. }
  27. for(int j=1; j<=2*i-1; j++)
  28. {
  29. cout<<i;
  30. }
  31. cout<<endl;
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement