Advertisement
NelIfandieva

Rocket_NoMethods

Jan 16th, 2020
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.67 KB | None | 0 0
  1. namespace Svetlina_Lab
  2. {
  3.     using System;
  4.  
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int num = int.Parse(Console.ReadLine());
  10.             int width = num * 3;
  11.             int dots = (width - 2) / 2;
  12.             int spaces = 0;
  13.            
  14.             for(int i = 1; i <= num; i++)
  15.             {
  16.                 Console.WriteLine("{0}{1}{2}{3}{0}",
  17.                     new string('.', dots),
  18.                     new string('/', 1),
  19.                     new string(' ', spaces),
  20.                     new string('\\', 1));
  21.                 dots--;
  22.                 spaces += 2;
  23.             }
  24.  
  25.             int intDots = num / 2;
  26.             int asterixNum = num * 2;
  27.             Console.WriteLine("{0}{1}{0}",
  28.                 new string('.', intDots),
  29.                 new string('*', asterixNum));
  30.  
  31.             int outerDotsNum = num / 2;
  32.             int slashesNum = num * 2 - 2;
  33.             for (int i = 1; i <= num * 2; i++)
  34.             {
  35.                 Console.WriteLine("{0}{1}{2}{1}{0}",
  36.                 new string('.', outerDotsNum),
  37.                 new string('|', 1),
  38.                 new string('\\', slashesNum));
  39.             }
  40.  
  41.             int dotDots = num / 2;
  42.             int asterAsterix = width - (dotDots * 2 + 2);
  43.             for (int i = 1; i <= num / 2; i++)
  44.             {
  45.                 Console.WriteLine("{0}{1}{2}{3}{0}",
  46.                     new string('.', dotDots),
  47.                     new string('/', 1),
  48.                     new string('*', asterAsterix),
  49.                     new string('\\', 1));
  50.  
  51.                 dotDots--;
  52.                 asterAsterix += 2;
  53.             }
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement