Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class NewHouse
- {
- static void Main(string[] args)
- {
- int oddNum = int.Parse(Console.ReadLine());
- char asterics = '*';
- char dash = '-';
- char floors = '|';
- int roofDash = (oddNum - 1) / 2;
- int astericsCount = 1;
- Console.Write(new string(dash,roofDash));
- Console.Write(asterics);
- Console.WriteLine(new string(dash,roofDash));
- roofDash--;
- astericsCount += 2;
- for (int i = 0; i <= oddNum; i++)
- {
- if(roofDash == 0)
- {
- Console.WriteLine(new string(asterics,astericsCount));
- break;
- }
- Console.Write(new string(dash,roofDash));
- Console.Write(new string(asterics,astericsCount));
- Console.WriteLine(new string(dash,roofDash));
- roofDash--;
- astericsCount += 2;
- }
- astericsCount -= 2;
- for (int i = 0; i < oddNum; i++)
- {
- Console.Write(floors);
- Console.Write(new string(asterics,astericsCount));
- Console.WriteLine(floors);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement