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;
- namespace Problem_3___Ace_of_Diamonds
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine("{0}", new string('*', n));
- int rows = n - 2;
- int first = (n - 3) / 2;
- int first2 = (n - 1) / 2;
- int first3 = 1;
- for (int i = 0; i < first2; i++)
- {
- if (n == 3)
- {
- Console.WriteLine("*@*");
- continue;
- }
- Console.WriteLine("*{0}{1}{0}*",
- new string('-', first),
- new string('@', first3),
- new string('-', first));
- first3 += 2;
- first--;
- if (first <=0)
- {
- first = 0;
- }
- }
- int second2 = 1;
- int second = n - 4;
- int secondRow = first2 - 1;
- for (int i = 0; i < secondRow; i++)
- {
- Console.WriteLine("*{0}{1}{0}*",
- new string('-', second2),
- new string('@', second),
- new string('-', second2));
- second2++;
- second -= 2;
- }
- Console.WriteLine("{0}", new string('*', n));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement