Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4. static void Main()
  5. {
  6. var n = int.Parse(Console.ReadLine());
  7. //top row
  8. Console.Write("+");
  9. for (int i = 0; i < n - 2; i++)
  10. {
  11. Console.Write(" -");
  12. }
  13. Console.WriteLine(" +");
  14. //middle row
  15. for (int rows = 0; rows < n-2; rows++)
  16. {
  17. Console.Write("|");
  18. for (int a = 0; a < n - 2; a++)
  19. Console.Write(" -");
  20. Console.WriteLine(" |");
  21. }
  22. //bottom row
  23. Console.Write("+");
  24. for (int i = 0; i < n - 2; i++)
  25. {
  26. Console.Write(" -");
  27. }
  28. Console.WriteLine(" +");
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement