grach

2016_18_Dec_Christmas Hat

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