Advertisement
Guest User

Untitled

a guest
Jun 7th, 2017
135
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.         var colSize = n / 2;
  8.         var midSize = 2*n-2*(n/2)-4;
  9.  
  10.         // Draw the first row
  11.         Console.WriteLine("/{0}\\{1}/{0}\\",new string('^', colSize),new string('_', midSize));
  12.         // Middle rows
  13.         for (var row = 1; row <= n - 3; row++)
  14.             Console.WriteLine("|{0}|", new string(' ', 2 * n - 2));
  15.         // Draw the row before the last
  16.         Console.WriteLine("|{0}{1}{0}|",new string(' ', colSize + 1),new string('_', midSize));
  17.         // Draw the last row
  18.         Console.WriteLine("\\{0}/{1}\\{0}/",new string('_', colSize),new string(' ', midSize));
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement