Advertisement
KlimentHristov

Figure.SummerTime

Nov 23rd, 2015
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 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 width = n * 2;
  9.  
  10.         Console.WriteLine("{0}{1}{0}",
  11.             new string(' ',n/2),new string('*',width/2+1),new string(' ',n/2));
  12.  
  13.         for (int i = 0; i < n/2+1; i++)
  14.         {
  15.             Console.WriteLine("{0}*{1}*{0}", new string (' ',n/2), new string (' ',n-1));
  16.         }
  17.         // magic
  18.         int magicOne = n / 2 - 1;
  19.         int middleMagic = n+1;
  20.         for (int i = 0; i < n / 2 - 1; i++)
  21.         {
  22.             Console.WriteLine("{0}*{1}*{0}",
  23.                 new string(' ', magicOne), new string(' ',middleMagic), new string(' ', magicOne));
  24.             magicOne--;
  25.             middleMagic += 2;
  26.         }
  27.         //
  28.  
  29.        
  30.         for (int i = 0; i < n; i++)
  31.         {
  32.             Console.WriteLine("*{0}*",new string ('.',width-2));
  33.         }
  34.         for (int i = 0; i < n; i++)
  35.         {
  36.             Console.WriteLine("*{0}*",new string ('@',width-2));
  37.         }
  38.         // End oF Bottle
  39.         Console.WriteLine(new string ('*',width));
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement