Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ChristmasSock
- {
- using System;
- static class ChristmasSock
- {
- static void Main()
- {
- string b = "|";
- string d = "-";
- string a = "*";
- string t = "~";
- string u = "_";
- string p = ".";
- string s = @"\";
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine(b + d.Times(2 * n) + b);
- Console.WriteLine(b + a.Times(2 * n) + b);
- Console.WriteLine(b + d.Times(2 * n) + b);
- int x = 2 * n - 3;
- int m = (x + 1) / 2;
- for (int i = 1; i <= x; i++)
- {
- int dd = Math.Abs(m - i) + 1;
- int tt = 2 * n - 2 * dd;
- Console.WriteLine(
- b +
- d.Times(dd) +
- t.Times(tt) +
- d.Times(dd) +
- b);
- }
- x = n + 3;
- m = (x + 1) / 2;
- for (int i = 1; i <= x; i++)
- {
- string line = (i == x ? u : p).Times(2 * n + 1);
- if (i == m - 1) { line = p.Times(n - 2) + "MERRY" + p.Times(n - 2); }
- if (i == m + 1) { line = p.Times(n - 2) + "X-MAS" + p.Times(n - 2); }
- Console.WriteLine(
- d.Times(i - 1) +
- s +
- line +
- (i == x ? ")" : s)
- );
- }
- }
- public static string Times(this string s, int x)
- {
- string newString = string.Empty;
- for (int i = 0; i < x; i++) { newString += s; }
- return newString;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement