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/359#4
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int number;
- cin >> number;
- int width = 3 * number;
- int points_first_loop = (width - 2) / 2;
- int spaces = 0;
- for (int i = 0; i < number; ++i)
- {
- cout << string(points_first_loop, '.')
- << '/'
- << string(spaces, ' ')
- << '\\'
- << string(points_first_loop, '.')
- << endl;
- points_first_loop--;
- spaces += 2;
- }
- int points = number / 2;
- cout << string(points, '.')
- << string(2 * number, '*')
- << string(points, '.')
- << endl;
- for (int i = 0; i < 2 * number; ++i)
- {
- cout << string(points, '.')
- << '|'
- << string(2 * number - 2, '\\')
- << '|'
- << string(points, '.')
- << endl;
- }
- int stars_third_loop = 2 * number - 2;
- for (int i = 0; i < number / 2; ++i)
- {
- cout << string(points, '.')
- << '/'
- << string(stars_third_loop, '*')
- << '\\'
- << string(points, '.')
- << endl;
- points--;
- stars_third_loop += 2;
- }
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement