Guest User

Untitled

a guest
Dec 1st, 2017
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.37 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text.RegularExpressions;
  5.  
  6. namespace Rextester
  7. {
  8.     public class Program
  9.     {
  10.         public static void Main(string[] args)
  11.         {
  12.             int n = int.Parse(Console.ReadLine());
  13.             Console.Write("{0}{0}{1}{0}{0}", new string('*', n), new string(' ', n), new string('*', n));
  14.             Console.WriteLine();
  15.             for (int i = 1; i < n - 1; i++)
  16.             {
  17.                 Console.Write("*");
  18.                 for(int y=0; y<(n*2)-2; y++) //chertae redove
  19.                 {
  20.                     Console.Write("/");
  21.                 }
  22.                 Console.Write("*");
  23.                
  24.                  if (i == Math.Ceiling((double)(n - 2) / 2)) { Console.Write( new string('|', n)); }
  25.                 else { Console.Write(new string(' ', n)); }
  26.                
  27.                 Console.Write("*");                                  //pochva vtoroto stuklo
  28.                 for (int y = 0; y < (n * 2) - 2; y++)
  29.                 {
  30.                     Console.Write("/");
  31.                 }
  32.                 Console.Write("*");
  33.                 Console.WriteLine();
  34.                
  35.             }
  36.            
  37.             Console.Write("{0}{0}{1}{0}{0}", new string('*', n), new string(' ', n), new string('*', n)); /// pochva nai dolen red
  38.             Console.WriteLine();
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment