Advertisement
aggressiveviking

Untitled

Mar 5th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05.ChristmasHat
  4. {
  5.     class ChristmasHat
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             int upperDots = (2 * n) - 1;
  12.            
  13.             Console.WriteLine("{0}/|\\{0}", new string('.', upperDots));
  14.             Console.WriteLine("{0}\\|/{0}", new string('.', upperDots));
  15.  
  16.             for (int row = 0; row < 2 * n; row++)
  17.             {
  18.                 int mainDashes = row;
  19.                 Console.WriteLine("{0}*{1}*{1}*{0}", new string('.', upperDots), new string('-', mainDashes));
  20.                 upperDots--;
  21.             }
  22.            
  23.             Console.WriteLine(new string('*', (4 * n) + 1));
  24.            
  25.             for (int i = 1; i <= (4 * n + 1) / 2; i++)
  26.             {
  27.                 Console.Write("*");
  28.                 Console.Write(".");
  29.             }
  30.            
  31.             Console.WriteLine("*");
  32.            
  33.             Console.WriteLine(new string('*', (4 * n) + 1));
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement