simonradev

ChristmassTree

Aug 10th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace LiveDemo
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int size = int.Parse(Console.ReadLine());
  14.  
  15.             int rows = size + 1;
  16.             for (int currentRow = 0; currentRow < rows; currentRow++)
  17.             {
  18.                 string emptySpaces = new string(' ', size - currentRow);
  19.                 string asterisk = new string('*', currentRow);
  20.  
  21.                 Console.WriteLine("{0}{1}{2}{1}", emptySpaces, asterisk, " | ");
  22.             }
  23.         }
  24.     }
  25. }
Add Comment
Please, Sign In to add comment