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 StopSign
- {
- class StopSign
- {
- static void Main(string[] args)
- {
- int size = int.Parse(Console.ReadLine());
- //printing the top row
- int sideDots = size + 1;
- int middleDashes = (size * 2 + 1) - 4;
- for (int currRow = 0; currRow < size + 1; currRow++)
- {
- char leftBorder = currRow == 0 ? '_' : '/';
- char rightBorder = currRow == 0 ? '_' : '\\';
- Console.Write(new string('.', sideDots - currRow));
- Console.Write(new string(leftBorder, 2));
- Console.Write(new string('_', middleDashes));
- Console.Write(new string(rightBorder, 2));
- Console.WriteLine(new string('.', sideDots - currRow));
- middleDashes += 2;
- }
- //printing the mid part
- int dashesAroundStopText = (middleDashes - 5) / 2;
- Console.WriteLine("//" +
- new string('_', dashesAroundStopText) +
- "STOP!" +
- new string('_', dashesAroundStopText) +
- @"\\");
- //printing the bot part
- for (int currRow = 0; currRow < size; currRow++)
- {
- Console.Write(new string('.', currRow));
- Console.Write(@"\\");
- Console.Write(new string('_', middleDashes));
- Console.Write("//");
- Console.WriteLine(new string('.', currRow));
- middleDashes -= 2;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment