psotirov

Fir Tree

Dec 10th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2.  
  3. class FirTree
  4. {
  5.     static void Main()
  6.     {
  7.         int N = int.Parse(Console.ReadLine());
  8.  
  9.         string firstLine = new string('.', N - 2) + "*" + new string('.', N - 2);
  10.         Console.WriteLine(firstLine);
  11.         for (int i = 1; i < N-1; i++)
  12.         {
  13.             Console.WriteLine(new string('.', N - i - 2) + new string('*', 2 * i + 1) + new string('.', N - i - 2));
  14.         }
  15.         Console.WriteLine(firstLine);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment