Advertisement
Guest User

Mask PB2018MARCH VK

a guest
Mar 12th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.61 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. using System.Globalization;
  7.  
  8. namespace zadacha5
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             int N = int.Parse(Console.ReadLine());
  15.             var width = (2 * N) + 2;
  16.  
  17.             // cycle 1
  18.             int spacesTimesOut = (width - 6) / 2;
  19.             int spacesTimesIn = 0;
  20.  
  21.             for (int c1 = 1; c1 <= N - 1; c1++)
  22.             {
  23.                 string total = new string(' ', spacesTimesOut) + "/"
  24.                                 + new string(' ', spacesTimesIn)
  25.                                 + "|  |" + new string(' ', spacesTimesIn)
  26.                                 + "\\";
  27.                 spacesTimesIn++;
  28.                 spacesTimesOut--;
  29.  
  30.                 Console.WriteLine(total);
  31.             }
  32.  
  33.             // hard code
  34.             spacesTimesOut = ((width - 4) - (N + 1)) / 2;
  35.             Console.WriteLine(new string('-', width));
  36.             //Console.WriteLine("|" + new string(' ', width -2)+"|");
  37.             Console.WriteLine("|" + new string(' ', spacesTimesOut) + "_" + new string(' ', N + 1) + "_" + new string(' ', spacesTimesOut) + "|");
  38.  
  39.             Console.WriteLine("|" + new string(' ', spacesTimesOut) + "@" + new string(' ', N + 1) + "@" + new string(' ', spacesTimesOut) + "|");
  40.  
  41.             // cycle 2
  42.  
  43.             for (int c2 = 1; c2 <= N / 2; c2++)
  44.             {
  45.                 Console.WriteLine("|" + new string(' ', width - 2) + "|");
  46.             }
  47.  
  48.             // hard code
  49.             spacesTimesOut = (width - 4) / 2;
  50.             Console.WriteLine("|" + new string(' ', spacesTimesOut) + "OO" + new string(' ', spacesTimesOut) + "|");
  51.             spacesTimesOut -= 1;
  52.             Console.WriteLine("|" + new string(' ', spacesTimesOut) + "/  \\" + new string(' ', spacesTimesOut) + "|");
  53.             Console.WriteLine("|" + new string(' ', spacesTimesOut) + "||||" + new string(' ', spacesTimesOut) + "|");
  54.  
  55.             // cycle 3
  56.             int dashBTimes = 1;
  57.             int dashFTimes = 1;
  58.             int tileTimes = width - 2;
  59.             for (int c3 = 1; c3 <= N; c3++)
  60.             {
  61.                 string total = new string('\\', dashBTimes) + new string('`', tileTimes) + new string('/', dashFTimes);
  62.                 Console.WriteLine(total);
  63.                 dashBTimes++;
  64.                 dashFTimes++;
  65.                 tileTimes-= 2;
  66.             }
  67.  
  68.             // hard code
  69.  
  70.             Console.WriteLine(new string('\\', width/2) + new string('/', width / 2));
  71.         }
  72.     }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement