Advertisement
Sammy24

#1393 DesenRomb

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