grach

SquareFrame

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