Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _03.IlluminatiLock
- {
- class IlluminatiLock
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- Console.Write(new string('.', n) + new string('#', n) + new string('.', n));
- Console.WriteLine();
- Console.Write(new string('.', n - 2) + new string('#', 3) + new string('.', n - 2)
- + new string('#', 3) + new string('.', n - 2));
- Console.WriteLine();
- int leftPoint;
- int midLeftPoint = 2;
- int midPoint = n-2 ;
- leftPoint = (3 * n - (8 + n)) / 2;
- //Top part of figure:
- for (int row = 2; row < (n + 1) / 2; row++)
- {
- Console.Write(new string('.', leftPoint));
- Console.Write(new string('#', 2));
- Console.Write(new string('.', midLeftPoint));
- Console.Write(new string('#', 1));
- Console.Write(new string('.', midPoint));
- Console.Write(new string('#', 1));
- Console.Write(new string('.', midLeftPoint));
- Console.Write(new string('#', 2));
- Console.Write(new string('.', leftPoint));
- midLeftPoint += 2;
- leftPoint -= 2;
- Console.WriteLine();
- }
- //Down part of figure
- midLeftPoint = ((3 * n - (6 + n)) / 2);
- midPoint = n - 2;
- leftPoint = 1;
- for (int row = 2; row < (n + 1) / 2; row++)
- {
- Console.Write(new string('.', leftPoint));
- Console.Write(new string('#', 2));
- Console.Write(new string('.', midLeftPoint));
- Console.Write(new string('#', 1));
- Console.Write(new string('.', n - 2));
- Console.Write(new string('#', 1));
- Console.Write(new string('.', midLeftPoint));
- Console.Write(new string('#', 2));
- Console.Write(new string('.', leftPoint));
- if (midLeftPoint>0)
- {
- midLeftPoint -= 2;
- leftPoint += 2;
- }
- Console.WriteLine();
- }
- Console.Write(new string('.', n - 2) + new string('#', 3) + new string('.', n - 2)
- + new string('#', 3) + new string('.', n - 2));
- Console.WriteLine();
- Console.Write(new string('.', n) + new string('#', n) + new string('.', n));
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement