bacco

Christmas toy

Feb 16th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.53 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Шевица
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             int w = 5 * n;
  12.             int h = 2 * n + 3;
  13.  
  14.             Console.Write("{0}{1}{0}",
  15.                          new string('-', (w - n) / 2),
  16.                              new string('*', n));
  17.             Console.WriteLine();
  18.  
  19.             ///        UP
  20.  
  21.             for (int i = 0; i < n / 2; i++)
  22.             {
  23.                 int upersantCout = n / 2 + 1 + i;
  24.                 string upersant = new string('&', upersantCout);
  25.  
  26.                 int starCout = 1 + i;
  27.                 string star = new string('*', starCout);
  28.  
  29.                 int minusCout = (w - starCout * 2 - upersantCout * 2) / 2;
  30.                 string minus = new string('-', minusCout);
  31.  
  32.                 Console.Write(minus + star + upersant + upersant + star + minus);
  33.  
  34.                 Console.WriteLine();
  35.             }
  36.  
  37.             for (int i = 0; i < n / 2; i++)
  38.             {
  39.                 int minusCout = n - 1 - i;
  40.                 string minus = new string('-', minusCout);
  41.  
  42.                 int drdCout = w - (minusCout * 2 + 4);
  43.                 string drd = new string('~', drdCout);
  44.  
  45.                 int starCout = 2;
  46.                 string star = new string('*', starCout);
  47.  
  48.  
  49.                 Console.Write(minus + star + drd + star + minus);
  50.  
  51.                 Console.WriteLine();
  52.             }
  53.  
  54.  
  55.  
  56.             ///        MID
  57.  
  58.             Console.Write("{0}{1}{2}{1}{0}",
  59.                           new string('-', n / 2),
  60.                           new string('*', 1),
  61.                           new string('|', w - (2 + n)));
  62.             Console.WriteLine();
  63.  
  64.             ///        MID
  65.  
  66.  
  67.             for (int i = n / 2; i > 0 ; i--)
  68.             {
  69.                 int minusCout = n  - i;
  70.                 string minus = new string('-', minusCout);
  71.  
  72.                 int drdCout = w - (minusCout * 2 + 4);
  73.                 string drd = new string('~', drdCout);
  74.  
  75.                 int starCout = 2;
  76.                 string star = new string('*', starCout);
  77.  
  78.  
  79.                 Console.Write(minus + star + drd + star + minus);
  80.  
  81.                 Console.WriteLine();
  82.             }
  83.             for (int i = n / 2; i > 0; i--)
  84.             {
  85.                 int upersantCout = n / 2  + i;
  86.                 string upersant = new string('&', upersantCout);
  87.  
  88.                 int starCout =  i;
  89.                 string star = new string('*', starCout);
  90.  
  91.                 int minusCout = (w - starCout * 2 - upersantCout * 2) / 2;
  92.                 string minus = new string('-', minusCout);
  93.  
  94.                 Console.Write(minus + star + upersant + upersant + star + minus);
  95.  
  96.                 Console.WriteLine();
  97.             }
  98.  
  99.  
  100.                 ///        DOWN
  101.  
  102.                 Console.Write("{0}{1}{0}",
  103.                               new string('-', (w - n) / 2),
  104.                                   new string('*', n));
  105.             }
  106.         }
  107.     }
  108.  
  109.  
  110. //                     Christmas toy            
  111. //                
  112. //           4     --------****--------
  113. //                 ------*&&&&&&*------
  114. //                 ----**&&&&&&&&**----
  115. //                 ---** ~~~~~~~~~~**---
  116. //                 --** ~~~~~~~~~~~~**--
  117. //                 --*||||||||||||||*--
  118. //                 --** ~~~~~~~~~~~~**--
  119. //                 ---** ~~~~~~~~~~**---
  120. //                 ----**&&&&&&&&**----
  121. //                 ------*&&&&&&*------
  122. //                 --------****--------
Advertisement
Add Comment
Please, Sign In to add comment