Guest User

Untitled

a guest
Aug 22nd, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. namespace ConsoleApplication4
  2. {
  3. using System;
  4. using System.Text;
  5.  
  6. public class Startup
  7. {
  8. public static void Main()
  9. {
  10. var n = int.Parse(Console.ReadLine());
  11.  
  12. var top = new StringBuilder();
  13. top.Append("/")
  14. .Append(new string('^', n / 2))
  15. .Append("\\")
  16. .Append(new string('_', n - (n / 2 + 2)))
  17. .Append(new string('_', n - (n / 2 + 2)))
  18. .Append("/")
  19. .Append(new string('^', n / 2))
  20. .Append("\\");
  21.  
  22. var middle = new StringBuilder();
  23. middle
  24. .Append("|")
  25. .Append(new string(' ', n * 2 - 2))
  26. .Append("|");
  27.  
  28. var lowestMiddle = new StringBuilder();
  29. lowestMiddle
  30. .Append("|")
  31. .Append(new string(' ', n / 2 + 1))
  32. .Append(new string('_', n - (n / 2 + 2)))
  33. .Append(new string('_', n - (n / 2 + 2)))
  34. .Append(new string(' ', n / 2 + 1))
  35. .Append("|");
  36.  
  37. var bottom = new StringBuilder();
  38. bottom
  39. .Append("\\")
  40. .Append(new string('_', n / 2))
  41. .Append("/")
  42. .Append(new string(' ', n - (n / 2 + 2)))
  43. .Append(new string(' ', n - (n / 2 + 2)))
  44. .Append("\\")
  45. .Append(new string('_', n / 2))
  46. .Append("/");
  47.  
  48.  
  49. var result = new StringBuilder();
  50. result
  51. .AppendLine(top.ToString());
  52.  
  53. for (int i = 1; i < n - 2; i++)
  54. {
  55. result.AppendLine(middle.ToString());
  56. }
  57.  
  58. result
  59. .AppendLine(lowestMiddle.ToString())
  60. .Append(bottom.ToString());
  61.  
  62. Console.WriteLine(result);
  63. }
  64. }
  65. }
Add Comment
Please, Sign In to add comment