Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //URL FOR THE TASK: https://judge.softuni.bg/Contests/Practice/Index/642#4
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int width = 4 * n + 1;
- int height = 2 * n + 1;
- cout << string(width, '#') << endl;
- int side_dots = 1;
- int inner_spaces = 1;
- for (int i = 0; i < n; i++)
- {
- int number_of_tags = (width - side_dots * 2 - inner_spaces) / 2;
- cout << string(side_dots, '.');
- cout << string(number_of_tags, '#');
- if (i == n / 2)
- {
- cout << string((inner_spaces - 3) / 2, ' ');
- cout << "(@)";
- cout << string((inner_spaces - 3) / 2, ' ');
- }
- else
- {
- cout << string(inner_spaces, ' ');
- }
- cout << string(number_of_tags, '#');
- cout << string(side_dots, '.') << endl;
- inner_spaces += 2;
- side_dots++;
- }
- for (int i = 0; i < n; i++)
- {
- cout << string(side_dots, '.');
- cout << string(width - side_dots * 2, '#');
- cout << string(side_dots, '.') << endl;
- side_dots++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement