Advertisement
Qrist

Christmas Tree

Apr 18th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     public static void Main(string[] args)
  6.     {
  7.         int n = int.Parse(Console.ReadLine());
  8.         int space = n;
  9.         int star = 0;
  10.         for (int i = 0; i < n+1; i++)
  11.         {
  12.             Console.Write(new string(' ',space));
  13.             Console.Write(new string('*',star));            
  14.             Console.Write(" | ");
  15.             Console.Write(new string('*', star));
  16.             Console.WriteLine();
  17.             space--;
  18.             star++;
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement