Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ChristmasHat
- {
- using System;
- static class ChristmasHat
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine('.'.Times(2 * n - 1) + @"/|\" + '.'.Times(2 * n - 1));
- Console.WriteLine('.'.Times(2 * n - 1) + @"\|/" + '.'.Times(2 * n - 1));
- for (int i = 0; i < 2 * n; i++)
- {
- Console.WriteLine(
- '.'.Times(2 * n - i - 1) +
- '*' + '-'.Times(i) +
- '*' + '-'.Times(i) +
- '*' +
- '.'.Times(2 * n - i - 1));
- }
- Console.WriteLine('*'.Times(4 * n + 1));
- Console.WriteLine("*" + ".*".Times(2 * n));
- Console.WriteLine('*'.Times(4 * n + 1));
- }
- static string Times(this char c, int x) => x <= 0 ? String.Empty : new string(c, x);
- static string Times(this string s, int x)
- {
- string newString = string.Empty;
- for (int i = 0; i < x; i++) { newString += s; }
- return newString;
- }
- }
- }
Add Comment
Please, Sign In to add comment