Advertisement
riff-raff

Znak STOP!

Feb 10th, 2018
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.64 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 ZnakStop
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             //INPUT
  14.             int n = int.Parse(Console.ReadLine());
  15.  
  16.             //Promenlivi
  17.             var midStopLines = (n * 4 - 6) / 2;
  18.             var midBotLines = n * 4 - 1;
  19.             string txt = "STOP!";
  20.             var topLeftRightDots = n + 1;
  21.             var topMidLines = n * 2 + 1;
  22.             var topMidLines2raw = n * 2 - 1;
  23.             var fullRangeRaw = n * 4 + 3;
  24.            
  25.  
  26.             //TOP
  27.             //Purvi red
  28.             Console.Write(new string('.', topLeftRightDots));
  29.             Console.Write(new string('_', topMidLines));
  30.             Console.WriteLine(new string('.', topLeftRightDots));
  31.             //Vtori red
  32.             Console.WriteLine(new string('.', n) + ("//") + (new string('_',topMidLines2raw)) + ("\\\\") + new string('.', n));
  33.  
  34.             //TOP-Cikul
  35.  
  36.             for (int i = 1; i <= n-1; i++)
  37.             {
  38.                 var topLeftRightSides = 2 * (n - i) + 4;
  39.  
  40.                 for (int j = 1; j <=n-i; j++)
  41.                 {
  42.                     Console.Write(".");
  43.                 }
  44.  
  45.                 Console.Write("//");
  46.                 Console.Write(new string('_',fullRangeRaw - topLeftRightSides));
  47.                 Console.Write(new string('\\',2));
  48.  
  49.                 for (int j = 1; j <= n - i; j++)
  50.                 {
  51.                     Console.Write(".");
  52.                 }
  53.                 Console.WriteLine();
  54.             }
  55.  
  56.             //MID
  57.             //stop
  58.             Console.WriteLine(new string('/', 2) + new string('_', midStopLines) + txt + new string('_', midStopLines) + new string('\\', 2));
  59.             //underStop
  60.             Console.WriteLine(new string('\\', 2) + new string('_', midBotLines) + new string('/', 2));
  61.  
  62.             //BOTT- Obraten Cikul
  63.            
  64.             for (int i = n-1; i >= 1; i--)
  65.             {
  66.                 var topLeftRightSides = 2 * (n - i) + 4;
  67.  
  68.                 for (int j = 1; j <= n - i; j++)
  69.                 {
  70.                     Console.Write(".");
  71.                 }
  72.  
  73.                 Console.Write(new string('\\', 2));
  74.                 Console.Write(new string('_', fullRangeRaw - topLeftRightSides));
  75.                 Console.Write(new string('/', 2));
  76.  
  77.                 for (int j = 1; j <= n - i; j++)
  78.                 {
  79.                     Console.Write(".");
  80.                 }
  81.                 Console.WriteLine();
  82.             }
  83.             Console.WriteLine();
  84.  
  85.         }
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement