Advertisement
DidiMilikina

05. Sheriff

Oct 8th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int number;
  8.     cin >> number;
  9.  
  10.     int dots = 3 * number / 2 - 1;
  11.     cout << string(3 * number / 2, '.') << "x" << string(3 * number / 2, '.') << endl;
  12.     cout << string(dots, '.') << "/x\\" << string(dots, '.') << endl;
  13.     cout << string(dots, '.') << "x|x" << string(dots, '.') << endl;
  14.  
  15.     for (int i = 0; i < number / 2; i++)
  16.     {
  17.         int dots_i = 3 * number / 2 - number - i;
  18.         int hyks_i = number + i;
  19.         cout << string(dots_i, '.') << string(hyks_i, 'x') << "|" << string(hyks_i, 'x') << string(dots_i, '.') << endl;
  20.     }
  21.  
  22.     for (int j = number / 2; j >= 0; j--)
  23.     {
  24.         int dots_j = 3 * number / 2 - number - j;
  25.         int hyks_j = number + j;
  26.         cout << string(dots_j, '.') << string(hyks_j, 'x') << "|" << string(hyks_j, 'x') << string(dots_j, '.') << endl;
  27.     }
  28.  
  29.     cout << string(dots, '.') << "/x\\" << string(dots, '.') << endl;
  30.     cout << string(dots, '.') << "\\x/" << string(dots, '.') << endl;
  31.  
  32.     for (int k = 0; k < number / 2; k++)
  33.     {
  34.         int dots_k = 3 * number / 2 - number - k;
  35.         int hyks_k = number + k;
  36.         cout << string(dots_k, '.') << string(hyks_k, 'x') << "|" << string(hyks_k, 'x') << string(dots_k, '.') << endl;
  37.     }
  38.  
  39.     for (int l = number / 2; l >= 0; l--)
  40.     {
  41.         int dots_l = 3 * number / 2 - number - l;
  42.         int hyks_l = number + l;
  43.         cout << string(dots_l, '.') << string(hyks_l, 'x') << "|" << string(hyks_l, 'x') << string(dots_l, '.') << endl;
  44.     }
  45.  
  46.     cout << string(dots, '.') << "x|x" << string(dots, '.') << endl;
  47.     cout << string(dots, '.') << "\\x/" << string(dots, '.') << endl;
  48.     cout << string(3 * number / 2, '.') << "x" << string(3 * number / 2, '.') << endl;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement