Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Sunglasses
- {
- public static void Main()
- {
- int height = int.Parse(Console.ReadLine());
- int width = 2 * height;
- string upperPart = new string('*', width);
- string bridge = new string('|', height);
- string bridgeSpace = new string(' ', height);
- int middleOfTheHeight = (height / 2) + 1;
- if (height % 2 != 0)
- {
- Console.WriteLine(upperPart + bridgeSpace + upperPart);
- for (int line = 0 ; line < height-2; line++)
- {
- if (line != (height-2)/2)
- {
- string lens = new string('/', width - 2);
- Console.WriteLine("*" + lens + "*" + bridgeSpace + "*" + lens + "*");
- }
- else if (line == (height-2)/2)
- {
- string lens = new string('/', width - 2);
- Console.WriteLine("*" + lens + "*" + bridge + "*" + lens + "*");
- }
- }
- string lowerPart = upperPart;
- Console.WriteLine(lowerPart + bridgeSpace + lowerPart);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement