Advertisement
bacco

Коледна Шапка; Christmas Hat

Feb 13th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.25 KB | None | 0 0
  1. using System;
  2.  
  3. namespace КоледнаШапка
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.             var n = int.Parse(Console.ReadLine());
  11.  
  12.             int widht = 4 * n + 1;
  13.             int hight = 2 * n + 5;
  14.  
  15.  
  16.             int dotTopCount = (widht - 3) / 2;
  17.             string dotTop = new string('.', dotTopCount);
  18.  
  19.             Console.WriteLine($"{dotTop}/|\\{dotTop}");
  20.             Console.WriteLine($"{dotTop}\\|/{dotTop}");
  21.  
  22.             // ''''''''
  23.  
  24.             for (int row = 0; row < n * 2; row++)
  25.             {
  26.                 for (int i = 0 + row ; i < (widht - 3) / 2; i++)
  27.                 {
  28.                     Console.Write(".");
  29.                 }
  30.  
  31.                 Console.Write("*");
  32.  
  33.                 for (int i = 0 - row; i < 0; i++)
  34.                 {
  35.                     Console.Write("-");
  36.                 }
  37.  
  38.                 Console.Write("*");
  39.  
  40.                 for (int i = 0 - row; i < 0; i++)
  41.                 {
  42.                     Console.Write("-");
  43.                 }
  44.  
  45.                 Console.Write("*");
  46.  
  47.                 for (int i = 0 + row; i < (widht - 3) / 2; i++)
  48.                 {
  49.                     Console.Write(".");
  50.                 }
  51.  
  52.                 Console.WriteLine();
  53.             }
  54.  
  55.             // ''''''''
  56.  
  57.             int dotDownCount = widht;
  58.             string dotDown = new string('*', dotDownCount);
  59.             Console.WriteLine($"{dotDown}");
  60.  
  61.             for (int i = 0; i < (widht - 1) / 2; i++)
  62.             {
  63.                 Console.Write("*.");
  64.             }
  65.             Console.Write("*");
  66.             Console.WriteLine();
  67.  
  68.  
  69.             Console.WriteLine($"{dotDown}");
  70.         }
  71.     }
  72. }
  73.  
  74.  
  75. //               4      ......./|\.......
  76. //                      .......\|/.......
  77. //                      .......***.......
  78. //                      ......*-*-*......
  79. //                      .....*--*--*.....
  80. //                      ....*---*---*....
  81. //                      ...*----*----*...
  82. //                      ..*-----*-----*..
  83. //                      .*------*------*.
  84. //                      *-------*-------*
  85. //                      *****************
  86. //                      *.*.*.*.*.*.*.*.*
  87. //                      *****************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement