koksibg

AX

Aug 31st, 2016
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace AX
  8. {
  9.     class AX
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int N = int.Parse(Console.ReadLine());
  14.             for (int i = 0; i < N; i++)
  15.                 Console.WriteLine(new string('-', 3 * N) + "*" + new string('-', i) + "*" + new string('-', 2 * N - 2 - i));
  16.             for (int j = 1; j <= N / 2; j++)
  17.                 Console.WriteLine(new string('*', 3 * N + 1) + new string('-', N - 1) + "*" + new string('-', N - 1));
  18.             if (N <= 2)
  19.             {
  20.                 Console.WriteLine(new string('-', 3 * N) + new string('*', N + 1) + new string('-', N - 1));
  21.                 return;
  22.             }
  23.             else if (N > 2 && N < 4)
  24.                     {
  25.                         Console.WriteLine(new string('-', 3 * N - 1) + new string('*', 2 * N) + new string('-', N - 2));
  26.                         return;
  27.                     }
  28.             else
  29.             {
  30.                 for (int k = 0; k < N / 2 - 1; k++)
  31.                 {
  32.                     Console.WriteLine(new string('-', 3 * N - k) + "*" + new string('-', N - 1 + 2 * k) + "*" + new string('-', N - 1 - k));
  33.                     if (k > N / 2 -3) Console.WriteLine(new string('-', 3 * N - k - 1) + new string('*', N + 3 + 2 * k) + new string('-', N - k - 2));
  34.                 }
  35.             }
  36.         }
  37.     }
  38. }
Add Comment
Please, Sign In to add comment