fbinnzhivko

03.01.King Of Thieves

Mar 19th, 2016
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2. public class KingOfThieves
  3. {
  4.     public static void Main()
  5.     {
  6.         int size = int.Parse(Console.ReadLine());
  7.         char gemSymbol = Console.ReadLine()[0];
  8.  
  9.         int outerDashes = size / 2;
  10.         int innerSymbols = 1;
  11.  
  12.         for (int row = 0; row < size; row++)
  13.         {
  14.             Console.WriteLine("{0}{1}{0}", new string('-', outerDashes), new string(gemSymbol, innerSymbols));
  15.  
  16.             if (row < size / 2) { outerDashes--; innerSymbols += 2; }
  17.             else { outerDashes++; innerSymbols -= 2; }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment