Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class HouseWithWindow
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int width = (2 * n) - 1;
- int height = (2 * n) + 2;
- int baseOfHouse = n+2;
- int windowWidth = n - 3;
- int windowHeght = n / 2;
- char dot = '.';
- // first row
- Console.WriteLine("{0}*{0}",new string(dot,width/2));
- // end first
- // second
- int secondDots = width/2-1;
- int secondInnerDots = 1;
- for (int i = 0; i < n-1; i++)
- {
- Console.WriteLine("{0}*{1}*{0}",
- new string(dot,secondDots), new string (dot,secondInnerDots));
- secondDots--;
- secondInnerDots += 2;
- }
- // end second
- // third row
- Console.WriteLine("{0}",new string ('*',width));
- // end third
- // four row
- for (int i = 0; i < n/4; i++)
- {
- Console.WriteLine("*{0}*",new string (dot,width-2));
- }
- // end four
- // five row
- for (int i = 0; i < n/2; i++)
- {
- Console.WriteLine("*{0}{1}{0}*",
- new string (dot,n/2),
- new string ('*',width-n-2));
- }
- // end five
- // six row
- for (int i = 0; i < n / 4; i++)
- {
- Console.WriteLine("*{0}*", new string(dot, width - 2));
- }
- // end six
- Console.WriteLine("{0}", new string ('*',width));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement