Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- using System.Threading;
- class TelerikLogo
- {
- static void Main()
- {
- Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- checked
- {
- byte numX = byte.Parse(Console.ReadLine());
- int numZ = numX / 2 + 1;
- int elemOnLine = (2 * numX) + (2 * ((numX / 2) + 1)) - 3;
- int countLines = elemOnLine;
- int halfLine = elemOnLine / 2 + 1;
- int midLine = numX;
- int elemBetweens = elemOnLine - (2 * ((numX / 2) + 1));
- int midOfDownPart = midLine + (elemBetweens / 2) + 1;
- for (int row = 1; row < midLine; row++)
- {
- for (int col = 1; col <= elemOnLine; col++)
- {
- if (col == numX / 2 + row || col == halfLine + numX - row
- || col == elemBetweens + numZ + row || col == numZ - row + 1)
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(".");
- }
- }
- Console.WriteLine();
- }
- for (int row = midLine; row <= countLines; row++)
- {
- for (int col = 1; col <= elemOnLine; col++)
- {
- if (row <= midOfDownPart && (col == numZ + (2 * numX) - row - 1 || col == (numX / 2) + row))
- {
- Console.Write("*");
- }
- else if (row > midOfDownPart && (col == row - numX - (numX / 2) + 1
- || col == countLines - row + halfLine))
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(".");
- }
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement