Advertisement
KlimentHristov

Figure.House

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