Advertisement
Guest User

Tree

a guest
Mar 12th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4.  
  5. namespace valeri
  6. {
  7.     class MainClass
  8.     {
  9.  
  10.  
  11.         public static void Main (string[] args)
  12.         {
  13.             int width = int.Parse(Console.ReadLine()); /// input = 5;
  14.  
  15.             for(int i = 0; i < (width -1) ; i++) ////// loopa she mine 4 puti za elha s viso4ina 5, zashtoto stulba she e otdelno
  16.             {
  17.                 Console.WriteLine("{0}{1}{2}",
  18.                     new String('.', (width - 2) - i),
  19.                     new string('*', 1 + (i*2)),
  20.                     new String('.', (width - 2) - i));
  21.             }
  22.  
  23.             Console.WriteLine("{0}*{0}", new string('.', width - 2));
  24.  
  25.  
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement