Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _5
  8. {
  9.     class Program
  10.     {
  11.         static void Main()
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.  
  15.             //int h = 4 * n - 2;
  16.             //int sh = 12 * n - 5;
  17.  
  18.             int x = 0;
  19.             int z = (12 * n - 6) / 2;
  20.  
  21.             for (int i = 0; i < (4 * n - 2) / 2 + 1; i++)
  22.             {
  23.                 Console.WriteLine("{0}{1}#{1}{0}", new string('.', z), new string('#', x));
  24.                 z -= 3;
  25.                 x += 3;
  26.             }
  27.  
  28.             z = 2;
  29.             x = ((12 * n - 5) - 6) / 2;
  30.             for (int i = 0; i < (4 * n - 2) / 2 - n; i++)
  31.             {
  32.                 Console.WriteLine("|{0}{1}#{1}{2}", new string('.', z), new string('#', x), new string('.', z + 1));
  33.                 z += 3;
  34.                 x -= 3;
  35.             }
  36.             for (int i = 0; i < n - 2; i++)
  37.             {
  38.                 Console.WriteLine("|{0}{1}#{1}{2}", new string('.', z - 3), new string('#', x + 3), new string('.', z + 1 - 3));
  39.             }
  40.             Console.WriteLine("@{0}{1}#{1}{2}", new string('.', z - 3), new string('#', x + 3), new string('.', z + 1 - 3));
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement