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/354#4
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int number;
- cin >> number;
- int width = 2 * number + 3;
- int lines = width - 4;
- for (int i = 1; i <= number; ++i)
- {
- cout << string(i, '*')
- << "\\"
- << string(lines, '-')
- << "/"
- << string(i, '*')
- << endl;
- lines -= 2;
- }
- int stars = (number - 1) / 2;
- int second_stars = number;
- for (int i = 0; i < number / 3; ++i)
- {
- cout << '|'
- << string(stars, '*')
- << "\\"
- << string(second_stars, '*')
- << '/'
- << string(stars, '*')
- << '|'
- << endl;
- stars++;
- second_stars -= 2;
- }
- int stars_third = width - 4;
- for (int i = 1; i <= number; ++i)
- {
- cout << string(i, '-')
- << "\\"
- << string(stars_third, '*')
- << "/"
- << string(i, '-')
- << endl;
- stars_third -= 2;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement