Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- int z = 1, s, n, c = 0, q, n1;
- cin>> n;
- n1 = n;
- s = n - 1;
- while (n > 0)
- {
- for (int i = 0; i < s; i++)
- cout << " ";
- for (int j = 0; j < z; j++)
- cout << "*";
- cout << endl;
- z += 2;
- s--;
- n--;
- }
- q = n1 - 1;
- z = 2 * n1 - 3;
- s = 1;
- while (q>0)
- {
- for (int w = 0; w<s; w++)
- cout << " ";
- for (int e = 0; e<z; e++)
- cout << "*";
- cout << endl;
- z -= 2;
- s++;
- q--;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement