fbinnzhivko

03.Ace of Diamonds

Mar 17th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 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.         Console.WriteLine("{0}", new string('*', n));
  9.         for (int row = 0; row < (n - 2) / 2; row++)
  10.         {
  11.      Console.WriteLine("*{0}{1}{0}*", new string('-', ((n - 2) / 2) - row), new string('@', 1 + row * 2));
  12.         }
  13.         for (int row = 0; row <= (n - 2) / 2; row++)
  14.         {
  15.       Console.WriteLine("*{0}{1}{0}*", new string('-', row), new string('@', n - 2 - (row * 2)));
  16.         }
  17.         Console.WriteLine("{0}", new string('*', n));
  18.  
  19.     }
  20. }
Add Comment
Please, Sign In to add comment