Advertisement
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 ChristmasSock
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- PrintTop(n);
- for (int i = 1; i <= n - 1; i++)
- {
- PrintMiddle(n, i);
- }
- for (int i = n - 2; i > 0; i--)
- {
- PrintMiddle(n, i);
- }
- for (int i = 1; i <= n + 2; i++)
- {
- if (i <= n / 2 || i > (n / 2) + 3)
- {
- string bottomDash = new string('-', i - 1);
- string bottomDots = new string('.', 2 * n + 1);
- Console.WriteLine($"{bottomDash}\\{bottomDots}\\");
- }
- else
- {
- string bottomDash = new string('-', i - 1);
- if (i == n / 2 + 1)
- {
- string strangeDots = new string('.', n - 2);
- Console.WriteLine($"{bottomDash}\\{strangeDots}MERRY{strangeDots}\\");
- }
- else if (i == n / 2 + 2)
- {
- string strangeDots = new string('.', 2 * n + 1);
- Console.WriteLine($"{bottomDash}\\{strangeDots}\\");
- }
- else
- {
- string strangeDots = new string('.', n - 2);
- Console.WriteLine($"{bottomDash}\\{strangeDots}X-MAS{strangeDots}\\");
- }
- }
- }
- PrintLast(n);
- }
- private static void PrintLast(int n)
- {
- string lastDash = new string('-', n + 2);
- string lastLines = new string('_', 2 * n + 1);
- Console.WriteLine($"{lastDash}\\{lastLines})");
- }
- private static void PrintTop(int n)
- {
- string UpperDashes = new string('-', n * 2);
- string UpperStars = new string('*', n * 2);
- Console.WriteLine($"|{UpperDashes}|");
- Console.WriteLine($"|{UpperStars}|");
- Console.WriteLine($"|{UpperDashes}|");
- }
- private static void PrintMiddle(int n, int i)
- {
- string middleDash = new string('-', n - i);
- string waves = new string('~', i * 2);
- Console.WriteLine($"|{middleDash}{waves}{middleDash}|");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement