Advertisement
Guest User

Untitled

a guest
Feb 5th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.  
  8.         int stars = 1;
  9.         int dashes = 2 * n - 1;
  10.  
  11.         for (int i = 0; i < n; i++)
  12.         {
  13.             Console.Write(new string('*', stars));
  14.             Console.Write('\\');
  15.             Console.Write(new string('-', dashes - 2 * i));
  16.             Console.Write('/');
  17.             Console.WriteLine(new string('*', stars));
  18.             stars++;
  19.         }
  20.         int stars1 = n / 2;
  21.         int midstars = n;
  22.  
  23.         for (int j = 0; j < n / 3; j++)
  24.         {
  25.             Console.Write('|');
  26.             Console.Write(new string('*', stars1));
  27.             Console.Write('\\');
  28.             Console.Write(new string('*', midstars - 2 * j));
  29.             Console.Write('/');
  30.             Console.Write(new string('*', stars1));
  31.             Console.WriteLine('|');
  32.             stars1++;
  33.         }
  34.         int dashes1 = 1;
  35.         dashes = 2 * n - 1;
  36.  
  37.         for (int k = 0; k < n; k++)
  38.         {
  39.             Console.Write(new string('-', dashes1));
  40.             Console.Write('\\');
  41.             Console.Write(new string('*', dashes-2 * k));
  42.             Console.Write('/');
  43.             Console.WriteLine(new string('-', dashes1));
  44.             dashes1 ++;
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement