Advertisement
VladimirDoktorov

Untitled

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