Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
159
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. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7.  
  8. cin >> n;
  9.  
  10. for (int i = 1; i <= (2 * n - 1) / 2 + 1; ++i)
  11. {
  12. for (int j = 1; j <= i; ++j)
  13. cout << ' ';
  14. for (int i = 1; i <= n; ++i)
  15. cout << '*';
  16. cout << '\n';
  17. }
  18.  
  19. for (int i = (2 * n - 1) / 2; i >= 1; --i)
  20. {
  21. for (int j = 1; j <= i; ++j)
  22. cout << ' ';
  23. for (int i = 1; i <= n; ++i)
  24. cout << '*';
  25. cout << '\n';
  26. }
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement