svetlozar_kirkov

New House

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