-
-
Save dhristoskov/fef0b9c0ea096e4a49dd 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; | |
namespace House | |
{ | |
class House | |
{ | |
static void Main(string[] args) | |
{ | |
int n = int.Parse(Console.ReadLine()); | |
int counter=1; | |
int roofEdge = n / 4; | |
Console.WriteLine("{0}{1}{0}",new string('.',n/2),"*"); | |
for (int i = 1; i <= n - 4; i = i + 2) | |
{ | |
Console.WriteLine("{0}{1}{2}{1}{0}",new string('.',(n/2-counter)), "*", new string('.',i)); | |
counter++; | |
} | |
Console.WriteLine("{0}", new string('*', n)); | |
for (int a = 1; a <= (n / 2 - 1); a++) | |
{ | |
Console.WriteLine("{0}{1}{2}{1}{0}", new string('.',n/4), "*",new string('.',(n-2*roofEdge-2))); | |
} | |
Console.WriteLine("{0}{1}{0}", new string('.', n / 4), new string('*',(n - 2 * roofEdge))); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment