iliya87

03.DrawWineGlass

Mar 26th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 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 WineGlass
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.            
  15.  
  16.            // Console.WriteLine("\\{0}/", new string('*',n-2));
  17.  
  18.             for (int i = 0; i < n/2; i++)
  19.             {
  20.                 Console.WriteLine("{0}\\{1}/{2}", new string ('.',i), new string('*',n-2-i*2), new string('.',i) );
  21.  
  22.             }
  23.  
  24.             if (n >= 12)
  25.             {
  26.                 for (int i = 0; i < n / 2-2; i++)
  27.                 {
  28.                     Console.WriteLine("{0}||{0}", new string('.', n / 2 - 1));
  29.                  
  30.  
  31.                 }
  32.                 Console.WriteLine(new string('-', n));
  33.                 Console.WriteLine(new string('-', n));
  34.             }
  35.             else
  36.             {
  37.                 for (int i = 0; i < n / 2 - 1; i++)
  38.                 {
  39.                     ConsoleDre.WriteLine("{0}||{0}", new string('.', n / 2 - 1));
  40.                    
  41.  
  42.                 }
  43.                 Console.WriteLine(new string('-', n));
  44.                  
  45.             }
  46.  
  47.  
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment