Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.75 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 ConsoleApp162
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.  
  15.             string tireta = StringCreater("-", n * 2);
  16.             Console.WriteLine($"|{tireta}|");
  17.  
  18.             string zvezdi = StringCreater("*", n * 2);
  19.             Console.WriteLine($"|{zvezdi}|");
  20.  
  21.             string tireta2 = StringCreater("-", n * 2);
  22.             Console.WriteLine($"|{tireta}|");
  23.  
  24.             var chertifor = n - 1;
  25.             var vulnichki = 2;
  26.             for (int i = 1; i <= n - 1; i++)
  27.             {
  28.                 string cherti3 = StringCreater("-", chertifor);
  29.                 string vulni = StringCreater("~", vulnichki);
  30.                 chertifor--;
  31.                 vulnichki = vulnichki + 2;
  32.                 Console.WriteLine($"|{cherti3}{vulni}{cherti3}|");
  33.  
  34.             }
  35.  
  36.             var tir = 2;
  37.             var vulni2 = n * 2 - 4;
  38.             for (int i = 1; i <= n - 2; i++)
  39.             {
  40.                 string cherti4 = StringCreater("-", tir);
  41.                 string vulni3 = StringCreater("~", vulni2);
  42.                 tir++;
  43.                 vulni2 = vulni2 - 2;
  44.  
  45.                 Console.WriteLine($"|{cherti4}{vulni3}{cherti4}|");
  46.             }
  47.  
  48.             var tochk = n * 2 + 1;
  49.             var tip = 0;
  50.  
  51.             for (int i = 1; i <= n + 2; i++)
  52.             {
  53.                 string toh = StringCreater(".", tochk);
  54.                 string tirencata = StringCreater("-", tip);
  55.  
  56.                 if (i == n / 2 + 1)
  57.                 {
  58.                     string tochif = StringCreater(".", n - 2);
  59.                     Console.WriteLine($"{tirencata}\\{tochif}MERRY{tochif}\\");
  60.                 }
  61.                 else if (i == (n / 2) + 3)
  62.                 {
  63.                     string tochidd = StringCreater(".", n - 2);
  64.                     Console.WriteLine($"{tirencata}\\{tochidd}X-MAS{tochidd}\\");
  65.                 }
  66.                 else
  67.                 {
  68.                     Console.WriteLine($"{tirencata}\\{toh}\\");
  69.                 }
  70.  
  71.                 tip++;
  72.             }
  73.  
  74.             string final = StringCreater("-", n + 2);
  75.             string final2 = StringCreater("_", n * 2 + 1);
  76.             Console.WriteLine($"{final}\\{final2})");
  77.  
  78.  
  79.         }
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.         public static string StringCreater(string text, int repeatCount)
  89.         {
  90.             string repeatedText = string.Empty;
  91.             for (int currentCount = 0; currentCount < repeatCount; currentCount++)
  92.             {
  93.                 repeatedText += text;
  94.             }
  95.             return repeatedText;
  96.         }
  97.     }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement