Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *
- **
- ***
- ****
- *****
- *****
- ****
- ***
- **
- *
- */
- #include <iostream>
- using std::cout;
- using std::cin;
- using std::endl;
- void main()
- {
- setlocale(LC_ALL, "Russian");
- int a, b = 0;
- cout << "Введите размер: "; cin >> a;
- a *= 2;
- for (int i = 0; i < a; i++, ((i == (a / 2)) ? cout << endl << endl : cout << endl))
- {
- if (i < (a / 2)) b++; else if (i == (a / 2)) b = a / 2; else b--;
- for (int j = (a / 2) + 1; j > b; j--, cout << " "); // выравнивание
- for (int k = 0; k < b; k++, cout << '*');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement