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 Mask
- {
- class Program
- {
- static void Main(string[] args)
- {
- var n = int.Parse(Console.ReadLine());
- var rowWidth = (2 * n) + 2;
- //top
- int emptySpaces = n - 2;
- int emptySpacesInside = 0;
- for (int i = 0; i < n - 1; i++)
- {
- Console.WriteLine("{0}/{1}| |{1}\\", new string(' ', emptySpaces), new string (' ',emptySpacesInside));
- emptySpacesInside++;
- emptySpaces--;
- }
- Console.WriteLine(new string ('-', rowWidth));
- //middle 2 rows
- int emptySpacesMiddleStart = n / 2 - 1;
- int emptySpacesMiddleInside = rowWidth - (emptySpacesMiddleStart * 2) - 4;
- Console.WriteLine("|{0}_{1}_{0}|", new string (' ', emptySpacesMiddleStart), new string (' ', emptySpacesMiddleInside));
- Console.WriteLine("|{0}@{1}@{0}|", new string(' ', emptySpacesMiddleStart), new string(' ', emptySpacesMiddleInside));
- //middlemiddle rows
- for (int i = 1; i <= n / 2; i++)
- {
- int emptySpacesMiddleMiddle = rowWidth - 2;
- Console.WriteLine("|{0}|", new string(' ', emptySpacesMiddleMiddle));
- }
- //mounth + nose
- int emptySpacesAroundNose = (rowWidth - 4) / 2;
- int emptySpacesAroundMounth = (rowWidth - 6) / 2;
- Console.WriteLine("|{0}OO{0}|", new string (' ', emptySpacesAroundNose));
- Console.WriteLine("|{0}/ \\{0}|", new string(' ', emptySpacesAroundMounth));
- Console.WriteLine("|{0}||||{0}|", new string(' ', emptySpacesAroundMounth));
- //bottom
- int dashesCount1 = 1;
- int dashesCount2 = 1;
- int dotsCount = rowWidth - 2;
- for (int row = 1; row <= n + 1; row++)
- {
- Console.WriteLine("{0}{1}{2}", new string('\\', dashesCount1), new string ('`', dotsCount), new string ('/', dashesCount2));
- dashesCount1++;
- dotsCount -= 2;
- dashesCount2++;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment