Advertisement
dobroslav_atanasov

SuareFrame

Nov 21st, 2016
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 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 SquareFrame
  8. {
  9.     class SquareFrame
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.  
  15.             Console.Write("+ ");
  16.             for (int i = 1; i <= n - 2; i++)
  17.             {
  18.                 Console.Write("- ");
  19.             }
  20.             Console.WriteLine("+");
  21.             for (int i = 1; i <= n - 2; i++)
  22.             {
  23.                 Console.Write("| ");
  24.                 for (int j = 1; j <= n - 2; j++)
  25.                 {
  26.                     Console.Write("- ");
  27.                 }
  28.                 Console.WriteLine("|");
  29.             }
  30.             Console.Write("+ ");
  31.             for (int i = 1; i <= n - 2; i++)
  32.             {
  33.                 Console.Write("- ");
  34.             }
  35.             Console.WriteLine("+");
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement