Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Task04Eggcelent
- {
- using System;
- class Program
- {
- static void Main()
- {
- string[] models = new string[] { "@.", ".@" };
- int eggSize = int.Parse(Console.ReadLine());
- string topAndBottom = string.Format("{0}{1}{0}",
- new string('.', eggSize + 1),
- new string('*', eggSize - 1));
- Console.WriteLine(topAndBottom);
- for (int i = eggSize - 1; i >= -(eggSize - 1); i -= 2)
- {
- if (i == -1)
- {
- for (int pattern = 0; pattern < 2; pattern++)
- {
- Console.Write(".*");
- for (int row = 0; row < (eggSize * 3 - 3) / 2; row++)
- {
- Console.Write("{0}", models[pattern]);
- }
- Console.WriteLine("{0}*.", models[pattern][0]);
- }
- }
- Console.WriteLine("{0}*{1}*{0}",
- new string('.', Math.Abs(i)),
- new string('.',((eggSize * 3 + 1) - (Math.Abs(i) * 2 + 2))));
- }
- Console.WriteLine(topAndBottom);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement