Created
July 26, 2014 19:15
-
-
Save boyanov83/870fc39797cc611d9018 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class TheExplorer | |
{ | |
static void Main() | |
{ | |
int n = int.Parse(Console.ReadLine()); | |
int outerDashes = 0; | |
int innerDashes = 1; | |
int lowerOuterDashes = 1; | |
int lowerInnerDashes = n-4; | |
Console.WriteLine("{0}*{0}", new string('-', (n - 1) / 2)); | |
for (int i = 0; i < (n-3)/2; i++) | |
{ | |
outerDashes = (n - 2 - innerDashes)/2; | |
Console.WriteLine("{0}*{1}*{0}", new string('-', outerDashes), new string('-', innerDashes)); | |
innerDashes += 2; | |
} | |
Console.WriteLine("*{0}*",new string('-', n-2)); | |
for (int i = 0; i < (n-3)/2; i++) | |
{ | |
lowerOuterDashes = (n-2-lowerInnerDashes)/2; | |
Console.WriteLine("{0}*{1}*{0}", new string('-', lowerOuterDashes), new string('-', lowerInnerDashes)); | |
lowerInnerDashes -= 2; | |
} | |
Console.WriteLine("{0}*{0}", new string('-', (n - 1) / 2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment