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/715#4
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int number;
- cin >> number;
- int width = number * 5;
- int first_dots = number;
- int second_dots = number;
- int first_sharps = 3 * number;
- for (int i = 0; i < number / 2; ++i)
- {
- cout << string(first_dots, '.')
- << string(first_sharps, '#')
- << string(second_dots, '.')
- << endl;
- first_dots++;
- first_sharps -= 2;
- second_dots++;
- }
- int points_middle = width - first_dots - second_dots - 2;
- for (int i = 0; i < number / 2 + 1; ++i)
- {
- cout << string(first_dots, '.')
- << '#'
- << string(points_middle, '.')
- << '#'
- << string(second_dots, '.')
- << endl;
- first_dots++;
- second_dots++;
- points_middle -= 2;
- }
- first_dots--;
- second_dots--;
- cout << string(first_dots, '.')
- << string(number, '#')
- << string(second_dots, '.')
- << endl;
- first_dots -= 2;
- second_dots -= 2;
- for (int i = 0; i < number / 2; ++i)
- {
- cout << string(first_dots, '.')
- << string(number + 4, '#')
- << string(second_dots, '.')
- << endl;
- }
- int dots = (width - 10 )/ 2;
- cout << string(dots, '.')
- << "D^A^N^C^E^"
- << string(dots, '.')
- << endl;
- for (int i = 0; i < number / 2 + 1; ++i)
- {
- cout << string(first_dots, '.')
- << string(number + 4, '#')
- << string(second_dots, '.')
- << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement