Advertisement
Sim0o0na

5. Mask

Mar 12th, 2018
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _5
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.  
  15.             if (n%2 != 0)
  16.             {
  17.                 int width = 2 * n + 2;
  18.                 int spaceRightLeft = n - 2;
  19.                 int spaceMiddle = width - 2 * spaceRightLeft - 4;
  20.  
  21.                 for (int i = 0; i < n-1; i++)
  22.                 {
  23.  
  24.                     Console.WriteLine("{0}/{1}|{2}|{1}\\", new string(' ', spaceRightLeft), new string(' ', i), new string(' ', spaceMiddle));
  25.                     spaceRightLeft--;                    
  26.                 }
  27.  
  28.                 Console.WriteLine($"{new string('-', width)}");
  29.  
  30.                 int rowss = n / 2 + 5;
  31.                 for (int row = 1; row <= rowss; row++)
  32.                 {
  33.                     int spaceLeftRight = (width - 4 - (n + 1))/2;
  34.                     if (row == 1)
  35.                     {
  36.                         Console.WriteLine("|{0}_{1}_{0}|", new string(' ', spaceLeftRight),new string(' ', n+1));
  37.                     }
  38.                     else if (row == 2)
  39.                     {
  40.                         Console.WriteLine("|{0}@{1}@{0}|", new string(' ', spaceLeftRight), new string(' ', n + 1));
  41.                     }
  42.                     else if (row == rowss)
  43.                     {
  44.                         int spaces = (width - 6)/ 2;
  45.                         Console.WriteLine("|{0}||||{0}|", new string(' ', spaces));
  46.                     }
  47.                     else if (row == rowss - 1)
  48.                     {
  49.                         int spaces = (width - 6) / 2;
  50.                         Console.WriteLine("|{0}/  \\{0}|", new string(' ', spaces));
  51.                     }
  52.                     else if (row == rowss-2)
  53.                     {
  54.                         int spaces = (width - 4) / 2;
  55.                         Console.WriteLine("|{0}OO{0}|", new string(' ', spaces));
  56.                     }
  57.                     else
  58.                     {
  59.                         Console.WriteLine($"|{new string(' ', width - 2)}|");
  60.                     }
  61.                 }
  62.  
  63.                 int apostrophe = width - 2;
  64.                 for (int i = 1; i <= n; i++)
  65.                 {
  66.                     Console.WriteLine("{0}{1}{2}", new string('\\', i), new string('`', apostrophe), new string('/', i));                    
  67.                     apostrophe -= 2;
  68.                    
  69.                 }
  70.  
  71.                 Console.WriteLine($"{new string('\\', n+1)}{new string('/', n+1)}");
  72.             }
  73.         }
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement