Advertisement
krasio12356

Pin

Apr 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.10 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.                                         // Pin
  5. string r(string s, int n)
  6. {
  7.     string answer;
  8.     for (int i = 0; i < n; i++)
  9.     {
  10.         answer = answer + s;
  11.     }
  12.     return answer;
  13. }
  14.  
  15. int main()
  16. {
  17.     int n;
  18.     cin >> n;
  19.     cout << "/`" << r("P", 2 * n) << r(" ", n) << "/`" << "I" << r(" ", n) << "/`" << "N" << r(" ", 2 * n + 1) << "N\n";
  20.     int j = 0;
  21.     for (int i = 1; i <= n - 1; i++, j++)
  22.     {
  23.         cout << "| P" << r(" ", 2 * n - 2) << "P" << r(" ", n) << "| I" << r(" ", n) << "| N" << r(" ", j) << "N" <<
  24.             r(" ", 2 * n - j) << "N" << endl;
  25.     }
  26.     cout << "| " << r("P", 2 * n) << r(" ", n) << "| " << "I" << r(" ", n) << "| " << "N" << r(" ", j) << "N" <<
  27.         r(" ", 2 * n - j) << "N" << endl;
  28.     j++;
  29.     for (int i = 0; i < n; i++, j++)
  30.     {
  31.         cout << "| " << r("P", n / 2) << r(" ", 3 * n - n / 2) << "| I" << r(" ", n) << "| N" << r(" ", j) << "N" <<
  32.             r(" ", 2 * n - j) << "N" << endl;
  33.     }
  34.     cout << "\\_" << r("P", n / 2) << r(" ", 3 * n - n / 2) << "\\_I" << r(" ", n) << "\\_N" << r(" ", j) << "N" <<
  35.         r(" ", 2 * n - j) << "N" << endl;
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement