RadoslavStamboliev

05. Draw Fort

Aug 6th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 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 Draw_Fort
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             var colSize = n / 2;
  15.             var midSize = 2 * n - 2 * colSize - 4;
  16.             Console.WriteLine("/{0}\\{1}/{0}\\",new string('^',colSize),new string('_', midSize));
  17.             for (int rows = 0; rows <= n-3; rows++)
  18.             {
  19.                 Console.WriteLine("|{0}|",new string(' ',2*n-2));
  20.                 Console.WriteLine("|{0}{1}{0}|",new string(' ', colSize + 1),new string('_', midSize));
  21.             }
  22.             Console.WriteLine("\\{0}/{1}\\{0}/",new string(' ', colSize), new string('_', midSize));
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment