Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace House
- {
- class House
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- var stars = 1;
- if (n % 2 == 0) stars++;
- for (int i = 0; i < (n + 1) / 2; i++)
- {
- var padding = (n - stars) / 2;
- Console.Write(new string('-', padding));
- Console.Write(new string('*', stars));
- Console.WriteLine(new string('-', padding));
- stars = stars + 2;
- }
- for (int j = 0; j < n / 2; j++)
- {
- Console.Write("|");
- Console.Write(new string('*', n - 2));
- Console.WriteLine("|");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement