Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Stars
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int width = 2 * n + 1;
- int outerDots1 = n;
- Console.WriteLine("{0}*{0}", new string('.', outerDots1));
- for (int i = 1; i < n/2; i++)
- {
- --outerDots1;
- int innerDots1 = width - 2*outerDots1 - 2;
- Console.WriteLine("{0}*{1}*{0}", (new string('.', outerDots1)), new string('.', innerDots1));
- }
- int midStars = n/2 + 1;
- int midDots = n - 1;
- Console.WriteLine("{0}{1}{0}", new string('*', midStars), new string('.', midDots));
- int outerDots2 = 1;
- for (int i = 0; i < n/2-1; i++)
- {
- int innerDots2 = width - 2 * (outerDots2 + i) - 2;
- Console.WriteLine("{0}*{1}*{0}", (new string('.',outerDots2+i)), new string('.', innerDots2));
- }
- int outerDots3 = n / 2;
- int legDots = n / 2 - 1;
- Console.WriteLine("{0}*{1}*{1}*{0}", (new string('.',outerDots3)), (new string('.', legDots)));
- for (int i = 0; i < n/2-1; i++)
- {
- outerDots3--;
- int innerDots3 = 1+2*i;
- Console.WriteLine("{0}*{1}*{2}*{1}*{0}", (new string('.', outerDots3)), (new string('.', legDots)) , (new string('.', innerDots3)));
- }
- Console.WriteLine("{0}{1}{0}", new string('*', midStars), new string('.', midDots));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment