Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _3.Eclipse
- {
- using System;
- public class Eclipse
- {
- public static void Main(string[] args)
- {
- checked
- {
- int height = int.Parse(Console.ReadLine());
- int widthLenses = (2 * height) - 2;
- int widthBridge = height - 1;
- string lensesStr = new string('/', widthLenses);
- lensesStr = '*' + lensesStr + '*';
- for (int row = 0; row < height; row++)
- {
- string spacesBetweenFrames;
- if (row == 0 || row == height - 1)
- {
- string asterisksSeq = new string('*', widthLenses);
- spacesBetweenFrames = new string(' ', height + 1);
- Console.WriteLine(" {0}{1}{0}", asterisksSeq, spacesBetweenFrames);
- }
- else if (row == height / 2)
- {
- string bridgeStr = new string('-', widthBridge);
- Console.WriteLine("{0}{1}{0}", lensesStr, bridgeStr);
- }
- else
- {
- spacesBetweenFrames = new string(' ', widthBridge);
- Console.WriteLine("{0}{1}{0}", lensesStr, spacesBetweenFrames);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement