Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- // input
- int N = int.Parse(Console.ReadLine());
- // logic
- string upFrames = new String('*', 2 * N); // This we will use for first and last rows of the frames.
- string betweenFrames = new String(' ', N); // This we will use for empty space between frames.
- string bridge = new String('|', N); // This we will use for bridge between frames.
- string lenses = new String('/', (2 * N) - 2); //This we will use for lense.
- int counter = 0; // This counter we will use for vertical draw
- // printing
- do
- {
- if (counter == 0 || counter == N - 1)
- {
- Console.WriteLine("{0}{1}{0}", upFrames, betweenFrames); //Here we print frames and spaces for first and last rows only.
- }
- else if (counter == N/2)
- {
- Console.WriteLine("*{0}*{1}*{0}*", lenses, bridge); //Here we print bridge. This is exactly the middle of sunglasses.
- }
- else
- {
- Console.WriteLine("*{0}*{1}*{0}*", lenses, betweenFrames); // Here we print frames and lenses for all rows without first and last.
- }
- counter++;
- } while (counter != N); //Here we finish our loop because we are at end position (N rows are drawn).
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement