Guest User

Untitled

a guest
Jan 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x;
  6. cin >> x;
  7. for (int i = 1; i <= x; ++i) {
  8. for (int j = 1; j <= (x-i); ++j) cout << " ";
  9. for (int k = 0; k < 2*i-1; ++k) cout << "*";
  10. cout << endl;
  11. }
  12. for (int i = 0; i < x-1; ++i) {
  13. for (int j = 1; j <= i+1; ++j) cout << " ";
  14. for (int k = 0; k < 2*(x-i-1)-1; ++k) cout << "*";
  15. cout << endl;
  16. }
  17. }
Add Comment
Please, Sign In to add comment