Advertisement
Ronka

Untitled

Jun 7th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 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 ConsoleApp2
  8. {
  9. class Program
  10. {
  11.  
  12.  
  13. static void Main(string[] args)
  14. {
  15. var n = int.Parse(Console.ReadLine());
  16.  
  17. PrintHeaderFooter(n);
  18.  
  19. for (int i = 0; i < n-2; i++)
  20. {
  21. PrintBodyLine(n);
  22.  
  23. }
  24.  
  25. PrintHeaderFooter(n);
  26. }
  27.  
  28. private static void PrintBodyLine(int n)
  29. {
  30. Console.Write("-");
  31. for (int i = 1; i < n; i++)
  32. {
  33. Console.Write("\\/");
  34. }
  35. Console.WriteLine("-");
  36. }
  37.  
  38. static void PrintHeaderFooter(int n)
  39. {
  40. Console.WriteLine(new string('-', 2*n));
  41.  
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement