Advertisement
Gesh4o

DrawFort

Mar 6th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. namespace _05.DrawFort
  2. {
  3. using System;
  4.  
  5. public class DrawFortMain
  6. {
  7. public static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10.  
  11. int pointerCount = n / 2;
  12. int underscopesCount = n - 4 + (n % 2);
  13.  
  14. // First row
  15. Console.WriteLine("{0}{1}{2}{3}{0}{1}{2}", '/', new string('^', pointerCount), '\\', new string('_', underscopesCount));
  16.  
  17. // Middle part
  18. for (int i = 0; i < n - 3; i++)
  19. {
  20. Console.WriteLine("{0}{1}{0}", '|', new string(' ', (2 * n) - 2));
  21. }
  22.  
  23. // End part
  24. Console.WriteLine("{0}{1}{2}{1}{0}", '|', new string(' ', pointerCount + 1), new string('_', underscopesCount));
  25.  
  26. Console.WriteLine("{0}{1}{2}{3}{0}{1}{2}", '\\', new string('_', pointerCount), '/', new string(' ', underscopesCount));
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement