Advertisement
KlimentHristov

Figure.AceOfDiamonds

Nov 28th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2. class AceOfDiamonds
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.  
  8.         // first
  9.         Console.WriteLine("{0}",new string ('*',n));
  10.         // end
  11.  
  12.         // second
  13.         int secondLines = n / 2 - 1;
  14.         int secondAt = 1;
  15.  
  16.         for (int i = 0; i < n/2-1; i++)
  17.         {
  18.             Console.WriteLine("*{0}{1}{0}*", new string('-', secondLines), new string('@', secondAt));
  19.             secondAt += 2;
  20.             secondLines--;
  21.         }
  22.         // end second
  23.         // third
  24.         Console.WriteLine("*{0}*",new string ('@',n-2));
  25.         // end third
  26.  
  27.         // four
  28.         for (int i = 0; i < n / 2 - 1; i++)
  29.         {
  30.             secondAt -= 2;
  31.             secondLines++;
  32.             Console.WriteLine("*{0}{1}{0}*", new string('-', secondLines), new string('@', secondAt));
  33.            
  34.         }
  35.         // end four
  36.         Console.WriteLine("{0}", new string('*', n));
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement