TodorovP

05 Sword

Apr 3rd, 2018
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.39 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 _05_Sword
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var n = int.Parse(Console.ReadLine()); //[4...50] 2 * n + 1
  14.  
  15.             //Top
  16.             string topBord = new string('#', n - 1);
  17.             Console.WriteLine("{0}/^\\{0}", topBord);
  18.             for (int i = 1; i <= n / 2; i++)
  19.             {                                
  20.                 string sharpsTopBord = new string('#', n - i - 1);
  21.                 string spasesTopMid = new string(' ', 2 * i + 1);
  22.                 Console.WriteLine("{0}.{1}.{0}", sharpsTopBord, spasesTopMid);
  23.             }
  24.  
  25.             //Middle
  26.             string sharpsMidBord = new string('#', n - n / 2 - 1);
  27.             string spasesMidMid = new string(' ', 2 * (n / 2) + 1);
  28.             string halfSpasesMidMid = new string(' ', (2 * (n / 2)) / 2);
  29.             Console.WriteLine("{0}|{1}S{1}|{0}", sharpsMidBord, halfSpasesMidMid);
  30.             Console.WriteLine("{0}|{1}O{1}|{0}", sharpsMidBord, halfSpasesMidMid);
  31.             Console.WriteLine("{0}|{1}F{1}|{0}", sharpsMidBord, halfSpasesMidMid);
  32.             Console.WriteLine("{0}|{1}T{1}|{0}", sharpsMidBord, halfSpasesMidMid);
  33.             if (n == 4) Console.WriteLine("{0}|{1}|{0}", sharpsMidBord, spasesMidMid);
  34.             for (int i = 0; i < n - 4; i++)
  35.             {
  36.                 Console.WriteLine("{0}|{1}|{0}", sharpsMidBord, spasesMidMid);                
  37.             }
  38.             Console.WriteLine("{0}|{1}U{1}|{0}", sharpsMidBord, halfSpasesMidMid);
  39.             Console.WriteLine("{0}|{1}N{1}|{0}", sharpsMidBord, halfSpasesMidMid);
  40.             Console.WriteLine("{0}|{1}I{1}|{0}", sharpsMidBord, halfSpasesMidMid);
  41.  
  42.             Console.WriteLine("@{0}@", new string('=', 2 * n - 1));
  43.  
  44.             //Bottom
  45.             string sharpsBottBord = new string('#', (n + 3) / 2);
  46.             string spacesBottMid = new string(' ', 2 * n + 1 - (((n + 3) / 2) * 2 + 2));
  47.             string dotsBottMid = new string('.', 2 * n + 1 - (((n + 3) / 2) * 2 + 2));
  48.             for (int i = 0; i < n / 2; i++)
  49.             {                
  50.                 Console.WriteLine("{0}|{1}|{0}", sharpsBottBord, spacesBottMid);
  51.             }
  52.             Console.WriteLine("{0}\\{1}/{0}", sharpsBottBord, dotsBottMid);
  53.         }
  54.     }
  55. }
Add Comment
Please, Sign In to add comment