Advertisement
fbinnzhivko

03.00 House with a Window

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