Skip to content

Instantly share code, notes, and snippets.

@nikolaiweselinow
Created June 8, 2015 06:03
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 nikolaiweselinow/bb1c370682d85d956369 to your computer and use it in GitHub Desktop.
Save nikolaiweselinow/bb1c370682d85d956369 to your computer and use it in GitHub Desktop.
using System;
class NewHouse
{
static void Main()
{
var n = int.Parse(Console.ReadLine());
var roof = (n / 2) + 1;
var star = '*';
for (int i = 1; i <= n ; i+=2)
{
Console.WriteLine("{0}{1}{0}",
new string('-', (n - i) / 2),
new string(star,i)
);
}
for (int i = 1; i <= n; i++)
{
Console.WriteLine("{0}{1}{0}",
new string('|', 1),
new string(star, (n - 2))
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment