SHARE
TWEET

Telerik FirTree

g-stoyanov Mar 19th, 2014 186 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Task03FirTree
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int height = int.Parse(Console.ReadLine());
  10.             int star = 1;
  11.             for (int i = height - 2; i >= 0; i--)
  12.             {
  13.                 Console.WriteLine(string.Format("{0}{1}{0}", new string('.', i), new string('*', star)));
  14.                 star += 2;
  15.             }
  16.  
  17.             Console.WriteLine(string.Format("{0}*{0}", new string('.', height - 2)));
  18.         }
  19.     }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top