LusienGG

[C#] DrawFort

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