Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Square_Frame
- {
- class Square_Frame
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- if (n > 0)
- {
- Console.Write("+");
- for (int i = 1; i <= n - 2; i++)
- {
- Console.Write(" -");
- }
- Console.WriteLine(" +");
- for (int j = 1; j <= n - 2; j++)
- {
- Console.Write("| ");
- for (int k = 1; k <= n - 2; k++)
- {
- Console.Write("- ");
- }
- Console.WriteLine("|");
- }
- Console.Write("+");
- for (int l = 1; l <= n - 2; l++)
- {
- Console.Write(" -");
- }
- Console.WriteLine(" +");
- }
- else return;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement