bacco

Квадратна рамка; Square Frame

Feb 7th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2.  
  3. namespace tESt
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var n = double.Parse(Console.ReadLine());
  10.  
  11.  
  12.             Console.Write("+ ");
  13.  
  14.             for (int i = 1; i <= n - 2; i++)
  15.             {
  16.                 Console.Write("- ");
  17.             }
  18.             Console.WriteLine("+ ");
  19.  
  20.  
  21.             for (int i = 1; i < n - 1; i++)
  22.             {
  23.                 Console.Write("| ");
  24.                 for (int j = 1; j <= n - 2; j++)
  25.                 {
  26.                     Console.Write("- ");
  27.                 }
  28.                 Console.Write("| ");
  29.  
  30.                 Console.WriteLine();
  31.             }
  32.             Console.Write("+ ");
  33.  
  34.             for (int i = 1; i <= n - 2; i++)
  35.             {
  36.                 Console.Write("- ");
  37.  
  38.             }
  39.             Console.WriteLine("+ ");
  40.  
  41.  
  42.  
  43.  
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment