Advertisement
Spocoman

Illuminati Lock

Oct 12th, 2023
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2.  
  3. namespace IlluminatiLock
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             Console.WriteLine("{0}{1}{0}", new string('.', n), new string('#', n));
  12.                
  13.             for (int i = 0; i < n - 1; i += 2)
  14.             {
  15.                 Console.WriteLine("{0}##{1}#{2}#{1}##{0}", new string('.', n - i - 2), new string('.', i), new string('.', n - 2));
  16.             }
  17.  
  18.             for (int i = n - 3; i >= 0; i -= 2)
  19.             {
  20.                 Console.WriteLine("{0}##{1}#{2}#{1}##{0}", new string('.', n - i - 2), new string('.', i), new string('.', n - 2));
  21.             }
  22.  
  23.             Console.WriteLine("{0}{1}{0}", new string('.', n), new string('#', n));
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement