Advertisement
rado8506

05. Christmas Hat

Feb 22nd, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 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 ConsoleApp38
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.  
  15.             int upperDots = (2 * n) - 1;
  16.             Console.WriteLine("{0}/|\\{0}", new string('.', upperDots));
  17.             Console.WriteLine("{0}\\|/{0}", new string('.', upperDots));
  18.            
  19.             for (int row = 0; row < 2*n; row++)
  20.             {
  21.                 int mainDashes = row;
  22.                 Console.WriteLine("{0}*{1}*{1}*{0}", new string('.', upperDots), new string('-', mainDashes));
  23.                 upperDots--;
  24.             }
  25.             Console.WriteLine(new string('*', (4 * n) + 1));
  26.             for (int i = 1; i <= (4 * n + 1)/2 ; i++)
  27.             {
  28.                 Console.Write("*");
  29.                 Console.Write(".");
  30.             }
  31.             Console.WriteLine("*");
  32.             Console.WriteLine(new string('*', (4 * n) + 1));
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement