Skip to content

Instantly share code, notes, and snippets.

@astambi

astambi/STOP.cs Secret

Created April 30, 2016 19:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save astambi/daad7bdab197a725250a4ba20713c51d to your computer and use it in GitHub Desktop.
Save astambi/daad7bdab197a725250a4ba20713c51d to your computer and use it in GitHub Desktop.
STOP
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _05_Problem
{
class STOP
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int rowLen = (n + 1) * 4 - 1;
// topSideLen = 2 * n + 1, height = (n + 1) * 2
for (int i = n + 1; i >= 0; i--)
{
if (i == n + 1)
Console.WriteLine("{0}{1}{0}",
new string('.', i),
new string('_', rowLen - 2 * i));
else if (i == 0)
Console.WriteLine("{0}//{1}STOP!{1}\\\\{0}",
new string('.', i),
new string('_', (rowLen - 9) / 2));
else
Console.WriteLine("{0}//{1}\\\\{0}",
new string('.', i),
new string('_', rowLen - 2 * i - 4));
}
for (int i = 0; i < n; i++)
{
Console.WriteLine("{0}\\\\{1}//{0}",
new string('.', i),
new string('_', rowLen - 2 * i - 4));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment