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());
- string dotTopHalf = new string('.', (n-1) / 2);
- string star = "*";
- string dot = ".";
- string roofTop = dotTopHalf + star + dotTopHalf;
- for (int i = 0; i < (n-1) / 2; i++)
- {
- if (i == 0)
- {
- Console.WriteLine(roofTop);
- }
- else
- {
- string dotHalf = new string('.', ((n - 1) / 2) - i);
- string dotMiddle = new string('.', (2 * i) - 1);
- Console.WriteLine(dotHalf + star + dotMiddle + star + dotHalf);
- }
- }
- string roofLow = new string('*', n);
- Console.WriteLine(roofLow);
- int wall = n / 4;
- for (int i = 0; i < (n - 1) / 2 - 1; i++)
- {
- Console.Write(new string('.', wall));
- Console.Write(new string('*', 1));
- Console.Write(new string('.', n - 2 * wall - 2));
- Console.Write(new string('*', 1));
- Console.WriteLine(new string('.', wall));
- }
- Console.Write(new string('.', wall));
- Console.Write(new string('*', n - 2 * wall));
- Console.WriteLine(new string('.', wall));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment