Advertisement
iordan_93

House

Apr 14th, 2014
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 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 firstDotsLength = (n - 1) / 2;
  9.         Console.WriteLine("{0}*{0}", new string('.', firstDotsLength));
  10.         for (int row = 0; row < (n - 3) / 2; row++)
  11.         {
  12.             Console.WriteLine("{0}*{1}*{0}", new string('.', --firstDotsLength), new string('.', 2 * row + 1));
  13.         }
  14.  
  15.         Console.WriteLine(new string('*', n));
  16.  
  17.         int outerDotsLength = n / 4;
  18.         for (int row = 0; row < (n + 1) / 2 - 2; row++)
  19.         {
  20.             Console.WriteLine("{0}*{1}*{0}", new string('.', outerDotsLength), new string('.', n - 2 * outerDotsLength - 2));
  21.         }
  22.  
  23.         Console.WriteLine("{0}{1}{0}", new string('.', outerDotsLength), new string('*', n - 2 * outerDotsLength));
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement