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