Advertisement
fbinnzhivko

Draw Fort

Mar 15th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2. class DrawJeans
  3. {
  4.     static void Main()
  5.     {
  6.         var n = int.Parse(Console.ReadLine());
  7.  
  8.         var colSize = n / 2;
  9.         var midSize = 2*n-2*(n/2)-4;
  10.  
  11.         // Draw the first row
  12.         Console.WriteLine("/{0}\\{1}/{0}\\",new string('^', colSize),new string('_', midSize));
  13.         // Middle rows
  14.         for (var row = 1; row <= n - 3; row++)
  15.             Console.WriteLine("|{0}|", new string(' ', 2 * n - 2));
  16.         // Draw the row before the last
  17.         Console.WriteLine("|{0}{1}{0}|",new string(' ', colSize + 1),new string('_', midSize));
  18.         // Draw the last row
  19.         Console.WriteLine("\\{0}/{1}\\{0}/",new string('_', colSize),new string(' ', midSize));
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement