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;
- class IlluminatiLock
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int width = 3 * n;
- int height = n + 1;
- Console.WriteLine("{0}{1}{0}",
- new string('.', n),
- new string('#', n),
- new string('.', n));
- int secondPart = n - 2;
- Console.WriteLine("{0}###{1}###{0}",
- new string('.', secondPart),
- new string('.', secondPart),
- new string('.', secondPart));
- int thirdPartRows = (n - 3) / 2;
- int thirdPart = n - 4;
- int thirdPart2 = 2;
- for (int i = 0; i < thirdPartRows; i++)
- {
- Console.WriteLine("{0}##{1}#{2}#{1}##{0}",
- new string('.', thirdPart),
- new string('.', thirdPart2),
- new string('.', secondPart),
- new string('.', thirdPart2),
- new string('.', thirdPart));
- thirdPart -= 2;
- thirdPart2 += 2;
- }
- int fourthPartRows = (n - 3) / 2;
- int fourthPart = 1;
- int fourthPart2 = n - 3;
- for (int i = 0; i < fourthPartRows; i++)
- {
- Console.WriteLine("{0}##{1}#{2}#{1}##{0}",
- new string('.', fourthPart),
- new string('.', fourthPart2),
- new string('.', secondPart),
- new string('.', fourthPart2),
- new string('.', fourthPart));
- fourthPart += 2;
- fourthPart2 -= 2;
- }
- // Console.WriteLine("{0}{1}{0}",
- //new string('.', n),
- //new string('#', n),
- //new string('.', n));
- //int secondPart = n - 2;
- Console.WriteLine("{0}###{1}###{0}",
- new string('.', secondPart),
- new string('.', secondPart),
- new string('.', secondPart));
- Console.WriteLine("{0}{1}{0}",
- new string('.', n),
- new string('#', n),
- new string('.', n));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement