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());
- //first part
- Console.Write(new string('.',n / 2 + 1));
- Console.Write(new string('*', n));
- Console.WriteLine(new string('.', n / 2 + 1));
- //second part
- int outerDots = n / 2;
- int innerDots = n / 2;
- for (int i = 0; i < n/2; i++)
- {
- Console.Write(new string('.',outerDots));
- Console.Write("*");
- Console.Write(new string('.', innerDots));
- Console.Write("*");
- Console.Write(new string('.', innerDots));
- Console.Write("*");
- Console.WriteLine(new string('.', outerDots));
- innerDots++;
- outerDots--;
- }
- //third part
- Console.WriteLine(new string('*',n * 2 + 1));
- //forth part
- outerDots = 1;
- innerDots = n - 2;
- for (int i = 0; i < n - 1; i++)
- {
- Console.Write(new string('.', outerDots));
- Console.Write("*");
- Console.Write(new string('.', innerDots));
- Console.Write("*");
- Console.Write(new string('.', innerDots));
- Console.Write("*");
- Console.WriteLine(new string('.', outerDots));
- innerDots--;
- outerDots++;
- }
- //fifth part
- Console.Write(new string('.',n));
- Console.Write("*");
- Console.WriteLine(new string('.', n));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement