Advertisement
Guest User

Untitled

a guest
May 12th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     cin >> n;
  9.     string spaces = string(n, ' ');
  10.     int spacesN1 = 0;
  11.     int spacesN2 = n * 2;
  12.     int spacesN3 = n;
  13.     int spacesN4 = n;
  14.  
  15.     cout << "/`" << string(2 * n, 'P') << spaces << "/`I" << spaces << "/`N" << string(n * 2 + 1, ' ') << "N" << endl;
  16.  
  17.     for (int row = 1; row <= n - 1; row++)
  18.     {
  19.         cout << "| P" << string(n * 2 - 2, ' ') << "P" << spaces << "| I" << spaces << "| N" << string(spacesN1, ' ') << "N" << string(spacesN2, ' ') << "N" << endl;
  20.         spacesN1++;
  21.         spacesN2--;
  22.     }
  23.  
  24.     cout << "| " << string(2 * n, 'P') << spaces << "| I" << spaces << "| N" << string(n - 1, ' ') << "N" << string(n + 1, ' ') << "N" << endl;
  25.  
  26.     for (int row = 1; row <= n + 1; row++)
  27.     {
  28.         if (row == n + 1)
  29.         {
  30.             cout << "\\_" << string(n/2, 'P')
  31.                 << string(3 * n - n /2, ' ') << "\\_I" << spaces << "\\_N" << string(spacesN3, ' ') << "N" << string(spacesN4, ' ') << "N" << endl;
  32.             spacesN3++;
  33.             spacesN4--;
  34.         }
  35.         else
  36.         {
  37.             cout << "| " << string(n/2, 'P') << string(3 * n - n /2, ' ') << "| I" << spaces << "| N" << string(spacesN3, ' ') << "N" << string(spacesN4, ' ') << "N" << endl;
  38.             spacesN3++;
  39.             spacesN4--;
  40.         }
  41.     }
  42.  
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement