Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- var n = int.Parse(Console.ReadLine());
- //top row
- Console.Write("+");
- for (int i = 0; i < n - 2; i++)
- {
- Console.Write(" -");
- }
- Console.WriteLine(" +");
- //middle row
- for (int rows = 0; rows < n-2; rows++)
- {
- Console.Write("|");
- for (int a = 0; a < n - 2; a++)
- Console.Write(" -");
- Console.WriteLine(" |");
- }
- //bottom row
- Console.Write("+");
- for (int i = 0; i < n - 2; i++)
- {
- Console.Write(" -");
- }
- Console.WriteLine(" +");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement