Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class DiamondTrolls
- {
- static void Main()
- {
- int N = int.Parse(Console.ReadLine());
- int width = (N * 2) + 1;
- int height = (6 + ((N - 3) / 2) * 3);
- int widthDiamond = N;
- int dot = ((width - N) / 2) - 1; // dobavqmi - i
- int dotTwo = ((width - N) / 2);
- int heightFirstPart = (height / 3) - 1;
- //firstPart
- Console.Write(new string('.', dotTwo));
- Console.Write(new string('*', N));
- Console.WriteLine(new string ('.', dotTwo));
- for (int i = 0; i < heightFirstPart; i++)
- {
- Console.Write(new string ('.', dot - i));
- Console.Write("*");
- Console.Write(new string ('.', dot + i));
- Console.Write("*");
- Console.Write(new string ('.', dot + i));
- Console.Write("*");
- Console.WriteLine(new string ('.', dot - i));
- }
- Console.WriteLine(new string ('*', width));
- //secondPart
- int dotSecondPart = (width - 5) / 2;
- for (int i = 0; i < N - 1; i++)
- {
- Console.Write(new string ('.', 1 + i));
- Console.Write("*");
- Console.Write(new string ('.', dotSecondPart - i));
- Console.Write("*");
- Console.Write(new string('.', dotSecondPart - i));
- Console.Write("*");
- Console.WriteLine(new string('.', 1 + i));
- }
- Console.Write(new string ('.', (width - 1) / 2));
- Console.Write("*");
- Console.WriteLine(new string('.', (width - 1) / 2));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement