Advertisement
Guest User

PIN

a guest
Apr 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.93 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _5_PIN
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             int width = 6 * n + 10;
  12.             int hight = 2 * n + 2;
  13.  
  14.             int spacesCount = n;
  15.             string spaces = new string(' ', n);
  16.             Console.WriteLine(@"/`" + new string('P', 2 * n) + spaces + "/`I" +
  17.                 spaces + "/`N" + new string(' ', 2 * n + 1) + "N");
  18.  
  19.             int leftSpacesCount = 0;
  20.             int rightSpacesCount = 2 * n;
  21.  
  22.             for (int row = 1; row <= n - 1; row++)
  23.             {
  24.                 Console.WriteLine("| P" + new string(' ', 2 * n - 2) + "P" +
  25.                     spaces + "| I" + spaces + "| N" + new string(' ', leftSpacesCount) +
  26.                     "N" + new string(' ', rightSpacesCount) + "N");
  27.                 leftSpacesCount++;
  28.                 rightSpacesCount--;
  29.             }
  30.  
  31.             string pS = n % 2 == 0 ? "P" : "PP";
  32.  
  33.             Console.WriteLine("| " + new string('P', 2 * n) + spaces + "| I" + spaces +
  34.                 "| N" + new string(' ', leftSpacesCount) + "N" +
  35.                 new string(' ', rightSpacesCount) + "N");
  36.  
  37.             int spacesPP = n % 2 == 0 ? n * 3 - 1 : n * 3 - 2;
  38.             leftSpacesCount += 1;
  39.             rightSpacesCount -= 1;
  40.  
  41.             for (int row = 1; row <= n; row++)
  42.             {
  43.                 Console.WriteLine("| " + pS + new string(' ', spacesPP) + "| I" + spaces +
  44.                     "| N" + new string(' ', leftSpacesCount) +
  45.                     "N" + new string(' ', rightSpacesCount) + "N");
  46.                 leftSpacesCount++;
  47.                 rightSpacesCount--;
  48.             }
  49.  
  50.             Console.WriteLine(@"\_" + pS + new string(' ', spacesPP) + @"\_I" + spaces +
  51.                     @"\_N" + new string(' ', leftSpacesCount) +
  52.                     "N" + new string(' ', rightSpacesCount) + "N");
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement