Advertisement
EmoRz

DrawFort

Aug 14th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. using System;
  2.  
  3. namespace DRawFort
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int num, n;
  10.             num = int.Parse(Console.ReadLine());
  11.  
  12.             var formula = num - 3;
  13.             var formula2 = num * 2 - 2;
  14.  
  15.             var formula3 = num / 2;
  16.             var FORMULAMid = 2 * num - 2 * formula3 - 4;
  17.  
  18.             Console.WriteLine(
  19.                 $"/{new string('^',formula3)}\\"
  20.                 +$"{new string('_', FORMULAMid)}"
  21.                 + $"/{new string('^', formula3)}\\");
  22.  
  23.             var testCol ="";
  24.  
  25.             for (int row = 1; row <= formula; row++)
  26.             {
  27.                 testCol = "|" + new string(' ', formula2) + "|";
  28.                 Console.WriteLine(testCol);
  29.             }
  30.  
  31.             Console.WriteLine(
  32.                  $"|{new string(' ', formula3+1)}"
  33.                    + $"{new string('_', FORMULAMid)}"
  34.                    + $"{new string(' ', formula3+1)}|");
  35.  
  36.             Console.WriteLine(
  37.                 $"\\{new string('_', formula3)}/"
  38.                 + $"{new string(' ', FORMULAMid)}"
  39.                 + $"\\{new string('_', formula3)}/");
  40.  
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement