Advertisement
fbinnzhivko

03.00 Wine Glass

Apr 17th, 2016
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.  
  8.         int dotsOut = 0;
  9.         int dotsInside = n - 2;
  10.  
  11.         for (int i = 0; i < n / 2; i++)
  12.         {
  13.             Console.WriteLine("{0}\\{1}/{0}", new String('.', dotsOut), new String('*', dotsInside));
  14.             dotsOut++;
  15.             dotsInside -= 2;
  16.         }
  17.         if (n < 12)
  18.         {
  19.             for (int i = 0; i < n / 2 - 1; i++)
  20.             {
  21.                 Console.WriteLine("{0}||{0}", new String('.', (n - 2) / 2));
  22.             }
  23.             Console.WriteLine("{0}", new String('-', n));
  24.         }
  25.         else
  26.         {
  27.             for (int i = 0; i < n / 2 - 2; i++)
  28.             {
  29.                 Console.WriteLine("{0}||{0}", new String('.', (n - 2) / 2));
  30.             }
  31.             for (int i = 0; i < n - (n / 2 - 2) - n / 2; i++)
  32.             {
  33.                 Console.WriteLine("{0}", new String('-', n));
  34.             }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement