Advertisement
KlimentHristov

Figure.HouseWithWindow

Nov 23rd, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.52 KB | None | 0 0
  1. using System;
  2. class HouseWithWindow
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.  
  8.         int width = (2 * n) - 1;
  9.         int height = (2 * n) + 2;
  10.         int baseOfHouse = n+2;
  11.         int windowWidth = n - 3;
  12.         int windowHeght = n / 2;
  13.         char dot = '.';
  14.  
  15.  
  16.         // first row
  17.         Console.WriteLine("{0}*{0}",new string(dot,width/2));
  18.         // end first
  19.  
  20.         // second
  21.         int secondDots = width/2-1;
  22.         int secondInnerDots = 1;
  23.         for (int i = 0; i < n-1; i++)
  24.         {
  25.             Console.WriteLine("{0}*{1}*{0}",
  26.                 new string(dot,secondDots), new string (dot,secondInnerDots));
  27.             secondDots--;
  28.             secondInnerDots += 2;
  29.         }
  30.         // end second
  31.        
  32.         // third row
  33.         Console.WriteLine("{0}",new string ('*',width));
  34.         // end third
  35.  
  36.         // four row
  37.         for (int i = 0; i < n/4; i++)
  38.         {
  39.             Console.WriteLine("*{0}*",new string (dot,width-2));
  40.         }
  41.         // end four
  42.  
  43.         // five row
  44.         for (int i = 0; i < n/2; i++)
  45.         {
  46.             Console.WriteLine("*{0}{1}{0}*",
  47.                 new string (dot,n/2),
  48.                 new string ('*',width-n-2));
  49.         }
  50.         // end five
  51.  
  52.         // six row
  53.         for (int i = 0; i < n / 4; i++)
  54.         {
  55.             Console.WriteLine("*{0}*", new string(dot, width - 2));
  56.         }
  57.         // end six
  58.         Console.WriteLine("{0}", new string ('*',width));
  59.  
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement