Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Contest80Task4TelerikLogo
- {
- static void Main()
- {
- int input = int.Parse(Console.ReadLine());
- int[,] matrix = new int[2 * input + (input - 2), 2 * input + (input - 2)];
- int count = 0;
- int x = 0;
- int y = (input - input / 2) - 1;
- int xMod = 1;
- int yMod = -1;
- while (count < 6)
- {
- if (count == 5 && x >= 2 * input + (input - 2) )
- {
- break;
- }
- if (y == 0 || y == (2 * input + (input - 2)) - 1)
- {
- yMod = yMod * -1;
- count++;
- }
- if (y == (2 * input) - 2)
- {
- xMod = xMod * -1;
- count++;
- }
- matrix[y, x] = 1;
- x = x + xMod;
- y = y + yMod;
- }
- for (int i = 0; i < 2 * input + (input - 2); i++)
- {
- for (int a = 0; a < 2 * input + (input - 2); a++)
- {
- if (matrix[i, a] == 1)
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(".");
- }
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement