Skip to content

Instantly share code, notes, and snippets.

@dhristoskov
Created March 3, 2015 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhristoskov/fef0b9c0ea096e4a49dd to your computer and use it in GitHub Desktop.
Save dhristoskov/fef0b9c0ea096e4a49dd to your computer and use it in GitHub Desktop.
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