Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- using System.Threading;
- public class PrintWineGlass
- {
- public static void Main()
- {
- Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- checked
- {
- int length = int.Parse(Console.ReadLine());
- int asteriskSeqWidth = length - 2;
- string asteriskSequence;
- int dotSeqWidth = 0;
- string outerDotSequence;
- string hyphenSequence = new string('-', length);
- for (int row = 0; row < length; row++)
- {
- if (row < length / 2)
- {
- asteriskSequence = new string('*', asteriskSeqWidth);
- outerDotSequence = new string('.', dotSeqWidth);
- Console.WriteLine("{0}\\{1}/{0}", outerDotSequence, asteriskSequence);
- dotSeqWidth++;
- asteriskSeqWidth -= 2;
- }
- else if (row == length - 1 || (length >= 12 && row == length - 2))
- {
- Console.WriteLine(hyphenSequence);
- }
- else
- {
- dotSeqWidth = (length / 2) - 1;
- outerDotSequence = new string('.', dotSeqWidth);
- Console.WriteLine("{0}||{0}", outerDotSequence);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement