bacco

Купа; Cup

Feb 13th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.07 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.            for (int r = 0; r <= n; r++)
  13.             {
  14.                 for (int col = n - r; col < n * 2; col++)
  15.                 {
  16.                     Console.Write(".");
  17.                 }
  18.  
  19.                 Console.Write("#");
  20.  
  21.  
  22.  
  23.                 ////
  24.                 for (int col = n + r ; col < n * 2 ; col++)
  25.                 {
  26.                     if (r < n / 2)
  27.                     {
  28.                         Console.Write("#");
  29.  
  30.                     }
  31.                     else
  32.                     {
  33.                         Console.Write(".");
  34.                     }
  35.                 }
  36.  
  37.                 for (int col = n; col < n * 2 - 2; col++)
  38.                 {
  39.                                         if (r < n / 2)
  40.                     {
  41.                         Console.Write("#");
  42.  
  43.                     }
  44.                     else
  45.                         if (r < n / 2)
  46.                     {
  47.                         Console.Write("#");
  48.  
  49.                     }
  50.                     else
  51.                     {
  52.                         Console.Write(".");
  53.                     }
  54.                 }
  55.  
  56.                 for (int col = n + r; col < n * 2; col++)
  57.                 {
  58.                     if (r < n / 2)
  59.                     {
  60.                         Console.Write("#");
  61.  
  62.                     }
  63.                     else
  64.                     {
  65.                         Console.Write(".");
  66.                     }
  67.                 }
  68.                 ////
  69.  
  70.                 Console.Write("#");
  71.  
  72.                 for (int col = n - r; col < n * 2; col++)
  73.                 {
  74.                     Console.Write(".");
  75.                 }
  76.                 Console.WriteLine();
  77.             }
  78.  
  79.             ///
  80.  
  81.             int widht = n / 2 * 10;
  82.  
  83.             int hashCount = n;
  84.             string hash = new string('#', hashCount);
  85.  
  86.             int dotMidCount = (widht - hashCount) / 2  ;
  87.             string dotMid = new string('.', dotMidCount);
  88.  
  89.             Console.WriteLine($"{dotMid}{hash}{dotMid}");
  90.  
  91.             ////
  92.            
  93.             for (int rol = 1; rol <= n + 2; rol++)
  94.             {
  95.  
  96.  
  97.                 int hashDownCount = n + 4;
  98.                 string hashDown = new string('#', hashDownCount);
  99.  
  100.                 int dotdownCount = (widht - hashDownCount) / 2;
  101.                 string dotDown = new string('.', dotdownCount);
  102.  
  103.                 int dotDownMidleCount = (hashDownCount - 10) / 2; // D^A^N^C^E^
  104.                 string dotDownMidle = new string('.', dotDownMidleCount);
  105.  
  106.                 int midRow = (n + 2) / 2;
  107.  
  108.                 if (rol == midRow)
  109.                 {
  110.                     Console.WriteLine($"{dotDown}{dotDownMidle}D^A^N^C^E^{dotDownMidle}{dotDown}");
  111.  
  112.                 }
  113.                 else
  114.                 {
  115.                     Console.WriteLine($"{dotDown}{hashDown}{dotDown}");
  116.                 }
  117.             }
  118.         }
  119.     }
  120. }
Advertisement
Add Comment
Please, Sign In to add comment