Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int number;
- cin >> number;
- int width = 2 * number - 1;
- int height = number / 2 + 4;
- cout << "@";
- cout << string(width / 2 - 1, ' ');
- cout << "@";
- cout << string(width / 2 - 1, ' ');
- cout << "@" << endl;
- cout << "**";
- cout << string(width / 2 - 2, ' ');
- cout << "*";
- cout << string(width / 2 - 2, ' ');
- cout << "**" << endl;
- int spaces = number - 5;
- int middle = 1;
- for (int i = 1; i <= number / 2 - 2; i++)
- {
- cout << "*";
- cout << string(i, '.');
- cout << "*";
- cout << string(spaces, ' ');
- cout << "*";
- cout << string(middle, '.');
- cout << "*";
- cout << string(spaces, ' ');
- cout << "*";
- cout << string(i, '.');
- cout << "*" << endl;
- spaces -= 2;
- middle += 2;
- }
- int firstPoints = number / 2 - 1;
- cout << "*";
- cout << string(firstPoints, '.');
- cout << "*";
- cout << string(width - (2 * firstPoints + 4), '.');
- cout << "*";
- cout << string(firstPoints, '.');
- cout << "*" << endl;
- cout << "*";
- cout << string(number / 2, '.');
- cout << string((number - 4) / 2, '*');
- cout << '.';
- cout << string((number - 4) / 2, '*');
- cout << string(number / 2, '.');
- cout << "*" << endl;
- for (int i = 0; i < 2; i++)
- {
- cout << string(width, '*') << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement