Advertisement
DidiMilikina

05. Fox

Oct 15th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. //URL FOR THE TASK: https://judge.softuni.bg/Contests/Practice/Index/354#4
  2.  
  3.  
  4. #include <iostream>
  5. #include <string>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int number;
  11.     cin >> number;
  12.  
  13.     int width = 2 * number + 3;
  14.  
  15.     int lines = width - 4;
  16.     for (int i = 1; i <= number; ++i)
  17.     {
  18.         cout << string(i, '*')
  19.             << "\\"
  20.             << string(lines, '-')
  21.             << "/"
  22.             << string(i, '*')
  23.             << endl;
  24.  
  25.         lines -= 2;
  26.     }
  27.  
  28.     int stars = (number - 1) / 2;
  29.     int second_stars = number;
  30.     for (int i = 0; i < number / 3; ++i)
  31.     {
  32.         cout << '|'
  33.             << string(stars, '*')
  34.             << "\\"
  35.             << string(second_stars, '*')
  36.             << '/'
  37.             << string(stars, '*')
  38.             << '|'
  39.             << endl;
  40.         stars++;
  41.         second_stars -= 2;
  42.     }
  43.  
  44.  
  45.     int stars_third = width - 4;
  46.     for (int i = 1; i <= number; ++i)
  47.     {
  48.         cout << string(i, '-')
  49.             << "\\"
  50.             << string(stars_third, '*')
  51.             << "/"
  52.             << string(i, '-')
  53.             << endl;
  54.  
  55.         stars_third -= 2;
  56.     }
  57.  
  58.     return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement