Advertisement
Svetli0o

Eggcelent

Apr 3rd, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.34 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. class Program
  8. {
  9.     static void Main(string[] args)
  10.     {
  11.         int n = int.Parse(Console.ReadLine());
  12.         int height = 2 * n;
  13.         int width = 3 * n - 1;
  14.         int area = 3 * n + 1;
  15.         int size = n - 1;
  16.         int counter = n - 1;
  17.         int counter2 = n + size;
  18.         int counter3 = 1;
  19.         int counter4 = width;
  20.         for (int i = 0; i < height; i++)
  21.         {
  22.             for (int j = 0; j < area; j++)
  23.             {
  24.                 if ((n + 1 <= j && j <= area - n - 2) && (i == 0 || i == height - 1))
  25.                 {
  26.                     Console.Write('*');
  27.                 }
  28.                 else if (j == counter && i != 0)
  29.                 {
  30.                     Console.Write('*');
  31.                     counter -= 2;
  32.                 }
  33.                 else if (j == counter2 && i != 0)
  34.                 {
  35.                     Console.Write('*');
  36.                 }
  37.                 else if (i > n / 2 && i < height - 1 && counter3 == j)
  38.                 {
  39.                     Console.Write('*');
  40.                 }
  41.                 else if (i > n / 2 && i < height - 1 && counter4 == j)
  42.                 {
  43.                     Console.Write('*');
  44.                 }
  45.                 else if (i == height / 2 - 1 && j >= 2 && j <= width - 1)
  46.                 {
  47.                     if (j % 2 == 0)
  48.                     {
  49.                         Console.Write('@');
  50.                     }
  51.                     else
  52.                     {
  53.                         Console.Write('.');
  54.                     }
  55.                 }
  56.                 else if (i == height / 2 && j >= 2 && j <= width - 1)
  57.                 {
  58.                     if (j % 2 == 0)
  59.                     {
  60.                         Console.Write('.');
  61.                     }
  62.                     else
  63.                     {
  64.                         Console.Write('@');
  65.                     }
  66.                 }
  67.                 else
  68.                 {
  69.                     Console.Write(".");
  70.                 }
  71.             }
  72.             if (i >= height - n / 2 - 1)
  73.             {
  74.                 counter3 += 2;
  75.                 counter4 -= 2;
  76.             }
  77.             counter2 += 2;
  78.             Console.WriteLine();
  79.         }
  80.     }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement