Advertisement
iliya87

03.DrawHouse

Mar 26th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2.  
  3. class House
  4. {
  5.     static void Main()
  6.     {
  7.         int n = int.Parse(Console.ReadLine());
  8.         int wall = n / 4;
  9.  
  10.         Console.WriteLine("{0}*{0}", new string('.',n/2));
  11.         int count = 1;
  12.         for (int i = 0; i < n/2-1; i++)
  13.         {
  14.             Console.WriteLine("{0}*{1}*{2}", new string('.',(n/2-1)-i),new string('.',count),new string('.',(n/2-1)-i));
  15.             count += 2;
  16.         }
  17.         Console.WriteLine(new string ('*',n));
  18.  
  19.         for (int i = 0; i < n/2-1; i++)
  20.  
  21.         {
  22.            
  23.             Console.WriteLine("{0}*{1}*{2}", new string ('.',wall), new string('.',n- (2* wall)-2), new string('.',wall));
  24.            
  25.         }
  26.         Console.WriteLine("{0}{1}{0}", new string('.', n / 4), new string('*', n - (2 * wall)));
  27.  
  28.      
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement