Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class WineGlass
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- char backSlash = '\\';
- char star = '*';
- char slash = '/';
- char verticalLine = '|';
- char dot = '.';
- char dash = '-';
- //top
- for (int i = 0, j = 0; i < n / 2; i++, j += 2)
- {
- Console.WriteLine("{0}{1}{2}{3}{0}", new string(dot, i), backSlash, new string(star, n - 2 - j), slash);
- }
- //middle and bottom
- if (n >= 12)
- {
- for (int i = 0; i < n / 2 - 2; i++)
- {
- Console.WriteLine("{0}{1}{0}", new string(dot, n / 2 - 1), new string(verticalLine, 2));
- }
- for (int i = 0; i < n - (n - 2); i++)
- {
- Console.WriteLine("{0}", new string(dash, n));
- }
- }
- else
- {
- for (int i = 0; i < n / 2 - 1; i++)
- {
- Console.WriteLine("{0}{1}{0}", new string(dot, n / 2 - 1), new string(verticalLine, 2));
- }
- for (int i = 0; i < n - (n - 1); i++)
- {
- Console.WriteLine("{0}", new string(dash, n));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement