Guest User

Untitled

a guest
Sep 1st, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 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 _05.Draw_Fort
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var n = int.Parse(Console.ReadLine());
  14. var dashes = (2 * n) - 2 * (n / 2) - 4;
  15. var spaces = (2 * n) - 2;
  16. for (int rows = 1; rows <= n; rows++)
  17. {
  18. if (rows == 1)
  19. {
  20. Console.Write('/');
  21. Console.Write(new string('^',n/2));
  22. Console.Write("\\");
  23. Console.Write(new string('_',(2 * n) - 2*(n/2) - 4));
  24. Console.Write('/');
  25. Console.Write(new string('^', n / 2));
  26. Console.Write("\\");
  27. }
  28. else if (rows == n)
  29. {
  30. Console.Write("\\");
  31. Console.Write(new string('_', n / 2));
  32. Console.Write("/");
  33. Console.Write(new string(' ',dashes));
  34. Console.Write("\\");
  35. Console.Write(new string('_', n / 2));
  36. Console.Write("/");
  37. }
  38. else
  39. { Console.Write("|");
  40. if (rows == n - 1)
  41. {
  42. Console.Write(new string(' ', n / 2 + 1 ));
  43. Console.Write(new string('_', dashes));
  44. Console.Write(new string(' ', n / 2 + 1));
  45. }
  46. else
  47. Console.Write(new string(' ',spaces));
  48. Console.Write("|");
  49. }
  50. Console.WriteLine();
  51. }
  52. }
  53. }
  54. }
Add Comment
Please, Sign In to add comment