Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class HouseWithAWindow
- {
- public static void Main()
- {
- checked
- {
- int num = int.Parse(Console.ReadLine());
- int width = (2 * num) - 1;
- int outerDots = num - 1;
- string outerDotSeq = new string('.', outerDots);
- Console.WriteLine("{0}*{0}", outerDotSeq);
- int innerDots = 1;
- string innerDotSeq;
- for (int row = 1; row < num; row++)
- {
- outerDots--;
- outerDotSeq = new string('.', outerDots);
- innerDotSeq = new string('.', innerDots);
- Console.WriteLine("{0}*{1}*{0}", outerDotSeq, innerDotSeq);
- innerDots += 2;
- }
- Console.WriteLine(new string('*', width));
- innerDotSeq = new string('.', width - 2);
- string innerAsteriskSeq = new string('*', num - 3);
- outerDots = num / 2;
- outerDotSeq = new string('.', outerDots);
- for (int row = 0; row < num; row++)
- {
- if (row < (num / 4) || row >= (num * 3) / 4)
- {
- Console.WriteLine("*{0}*", innerDotSeq);
- }
- else
- {
- Console.WriteLine("*{0}{1}{0}*", outerDotSeq, innerAsteriskSeq);
- }
- }
- Console.WriteLine(new string('*', width));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement