Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int x;
- cin >> x;
- for (int i = 1; i <= x; ++i) {
- for (int j = 1; j <= (x-i); ++j) cout << " ";
- for (int k = 0; k < 2*i-1; ++k) cout << "*";
- cout << endl;
- }
- for (int i = 0; i < x-1; ++i) {
- for (int j = 1; j <= i+1; ++j) cout << " ";
- for (int k = 0; k < 2*(x-i-1)-1; ++k) cout << "*";
- cout << endl;
- }
- }
Add Comment
Please, Sign In to add comment