Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Eggcelent
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int width = n * 3 + 1;
- int height = 2 * n;
- int dotCounter = n + 1;
- int counter = 0;
- //first line --> special
- Console.Write(new string('.', dotCounter));
- Console.Write(new string ('*', n-1));
- Console.WriteLine(new string('.', dotCounter));
- //top
- int innterDotCounter = 0;
- if (n == 2)
- {
- innterDotCounter = 3;
- }
- else
- {
- innterDotCounter = n - 3;
- for (int i = n - 1; i >= 1; i -= 2)
- {
- innterDotCounter += 4;
- dotCounter -= 2;
- Console.Write(new string('.', dotCounter));
- Console.Write('*');
- Console.Write(new string('.', innterDotCounter));
- Console.Write('*');
- Console.WriteLine(new string('.', dotCounter));
- counter++;
- }
- }
- //special part
- int specialCounter = (2 * n - (4 + 2 * counter)) / 2;
- if (specialCounter > 0)
- {
- for (int i = 0; i < specialCounter; i++)
- {
- Console.Write(".*");
- Console.Write(new string('.', width - 4));
- Console.WriteLine("*.");
- }
- }
- //middle
- Console.Write(".*");
- for (int i = 1; i <= (innterDotCounter - 1) / 2; i++)
- {
- Console.Write("@.");
- }
- Console.Write('@');
- Console.WriteLine("*.");
- Console.Write(".*");
- for (int i = 1; i <= (innterDotCounter - 1) / 2; i++)
- {
- Console.Write(".@");
- }
- Console.Write('.');
- Console.WriteLine("*.");
- //special part
- if (specialCounter > 0)
- {
- for (int i = 0; i < specialCounter; i++)
- {
- Console.Write(".*");
- Console.Write(new string('.', width - 4));
- Console.WriteLine("*.");
- }
- }
- //bottom
- if (n == 2)
- {
- innterDotCounter = 3;
- }
- else
- {
- for (int i = 1; i <= n - 1; i += 2)
- {
- Console.Write(new string('.', dotCounter));
- Console.Write('*');
- Console.Write(new string('.', innterDotCounter));
- Console.Write('*');
- Console.WriteLine(new string('.', dotCounter));
- dotCounter += 2;
- innterDotCounter -= 4;
- }
- }
- //last line == first line
- Console.Write(new string('.', n + 1));
- Console.Write(new string('*', n - 1));
- Console.WriteLine(new string('.', n + 1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement