mkpetrov

Untitled

Dec 22nd, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.45 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 Problem_05.Christmas_Hat
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             int OuterDots = n * 2 - 1;
  15.             int InnerDashes = 1;
  16.             var Pipes = magicString("*.",(4*n+1)/2);
  17.  
  18.             Console.WriteLine(@"{0}/|\{0}",new string('.',OuterDots),new string('.',OuterDots));
  19.             Console.WriteLine(@"{0}\|/{0}",new string('.', OuterDots), new string('.', OuterDots));
  20.             Console.WriteLine("{0}{1}{0}",new string('.',OuterDots),new string('*',3));
  21.             OuterDots--;
  22.             for (int i = 0; i < n*2-1; i++)
  23.             {
  24.                 Console.WriteLine("{0}*{1}*{1}*{0}",new string('.',OuterDots),new string('-',InnerDashes));
  25.                 OuterDots--;
  26.                 InnerDashes++;
  27.             }
  28.             Console.WriteLine("{0}",new string('*',4*n+1));
  29.             Console.WriteLine("{0}*",Pipes);
  30.             Console.WriteLine("{0}", new string('*', 4 * n + 1));
  31.         }
  32.  
  33.  
  34.  
  35.  
  36.         public static string magicString(string text, int repearCount)
  37.         {
  38.             string OutputText = "";
  39.             for (int i = 0; i < repearCount; i++)
  40.             {
  41.                 OutputText = OutputText + text;
  42.             }
  43.  
  44.             return OutputText;
  45.         }
  46.     }
  47. }
Add Comment
Please, Sign In to add comment