Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class ConsoleApplication1
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- for (int i = 0; i < n; i++)
- {
- string outerdashes = new string('-', n / 2);
- if (i == 0)
- {
- string firstLineStars1 = new string('*', n + 2);
- Console.WriteLine(outerdashes + firstLineStars1 + outerdashes);
- }
- else
- {
- string innerDashes = new string('-', n);
- Console.WriteLine(outerdashes + "*" + innerDashes + "*" + outerdashes);
- }
- }
- int equal = 0;
- for (int j = n / 2; j >= 0; j--)
- {
- string headphoneStars = new string('*', n - 2 * j);
- string outerDashes = new string('-', (n - (n - 2 * j)) / 2);
- string innerDashes = new string('-', 1);
- Console.WriteLine(outerDashes + headphoneStars + outerDashes + innerDashes + outerDashes + headphoneStars + outerDashes);
- }
- int equal1 = 0;
- for (int p = 1; p < n / 2 + 1; p++)
- {
- int counter = n - p;
- if (counter % 2 == 0)
- {
- counter--;
- }
- if (counter == equal)
- {
- counter -= 2;
- }
- string headphoneStars = new string('*', n - 2 * p);
- string outerDashes = new string('-', (n - (n - 2 * p)) / 2);
- string innerDashes = new string('-', 1);
- Console.WriteLine(outerDashes + headphoneStars + outerDashes + innerDashes + outerDashes + headphoneStars + outerDashes);
- equal1 = counter;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment