Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _5_SublimeLogo
- {
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int width = 2 * n;
- char space = ' ';
- char star = '*';
- int spacesCount = width - 2;
- int starsCount = 2;
- // Upper Part
- for (int i = 1; i <= n; i++)
- {
- Console.WriteLine(new string(space, spacesCount) + new string(star, starsCount));
- spacesCount -= 2;
- starsCount += 2;
- }
- // Middle Part
- starsCount = n * 2 -2;
- for (int i = 1; i <= 2; i++)
- {
- Console.WriteLine(new string(star, starsCount));
- starsCount -= 2;
- }
- starsCount = width - 2;
- for (int i = 1; i <= 2; i++)
- {
- Console.WriteLine(new string(star, starsCount));
- starsCount += 2;
- }
- spacesCount = 2;
- starsCount = width - 2;
- Console.WriteLine((new string(space, spacesCount) + new string(star, starsCount)));
- spacesCount += 2;
- starsCount -= 2;
- Console.WriteLine((new string(space, spacesCount) + new string(star, starsCount)));
- spacesCount = 2;
- starsCount = width - 2;
- Console.WriteLine((new string(space, spacesCount) + new string(star, starsCount)));
- // Bottom Part
- spacesCount = 0;
- starsCount = width;
- for (int i = 0; i < n; i++)
- {
- Console.WriteLine(new string(star, starsCount));
- starsCount -= 2;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement