Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- class AceOfDiamonds
- {
- static void Main()
- {
- int size = int.Parse(Console.ReadLine());
- int topDash = ((size - 1) / 2) - 1;
- int topSymbol = 1;
- int bottomDash = 1;
- int bottomSymbol = size - 4;
- string firstAndLastRow = new string('*', size); // First row
- Console.WriteLine(firstAndLastRow);
- while (topDash >= 0)
- {
- string insideUpRows = "*" + new string('-', topDash) + new string('@', topSymbol) + new string('-', topDash) + "*"; // Top half + middle part
- Console.WriteLine(insideUpRows);
- topDash--;
- topSymbol += 2;
- }
- while (bottomSymbol >= 1)
- {
- string insideDownRows = "*" + new string('-', bottomDash) + new string('@', bottomSymbol) + new string('-', bottomDash) + "*"; // Bottom half
- Console.WriteLine(insideDownRows);
- bottomDash++;
- bottomSymbol -= 2;
- }
- Console.WriteLine(firstAndLastRow); // Last row
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement