Advertisement
g-stoyanov

Task03NewHowse

Apr 14th, 2014
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. namespace Task03NewHowse
  2. {
  3.     using System;
  4.  
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int height = int.Parse(Console.ReadLine());
  10.             Console.WriteLine(string.Format("{0}*{0}", new string('-', (height - 1) / 2)));
  11.             for (int i = ((height - 1) / 2) - 1; i >= 0; i--)
  12.             {
  13.                 Console.WriteLine(string.Format("{0}{1}{0}", new string('-', i), new string('*', (height - 2 * i))));
  14.             }
  15.  
  16.             for (int i = 0; i < height; i++)
  17.             {
  18.                 Console.WriteLine("|{0}|", new string('*', height - 2));
  19.             }
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement