Advertisement
Guest User

Untitled

a guest
Apr 18th, 2017
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.         for (int i = 0; i < n; i++)
  8.         {
  9.             Console.WriteLine("{0}*{1}*{2}", new string('-', 3 * n), new string('-', i), new string('-', 2 * n - 2 - i));
  10.         }
  11.         for (int i = 0; i < n / 2; i++)
  12.         {
  13.             Console.WriteLine("{0}*{1}*{1}", new string('*', n * 3), new string('-', n - 1));
  14.         }
  15.         for (int i = 0; i < n / 2; i++)
  16.         {
  17.             if (i == n / 2 - 1)
  18.             {
  19.                 Console.WriteLine("{0}*{1}*{2}", new string('-', (3 * n) - i), new string('*', n - 1 + (i * 2)), new string('-', n - 1 - i));
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine("{0}*{1}*{2}", new string('-', n * 3 - i), new string('-', n - 1 + i + i), new string('-', n - 1 - i));
  24.             }
  25.  
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement