Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace christmastree
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = 1 + int.Parse(Console.ReadLine());
- for (int i = 1; i <=n; i++ )
- {
- var spaces = n - i;
- for (int j = 0; j < spaces; j++ )
- {
- Console.Write(" ");
- }
- var asterix = i - 1;
- for (int j = 0; j < asterix; j++ )
- {
- Console.Write("*");
- }
- Console.Write(" | ");
- for (int j = 0; j < asterix; j++)
- {
- Console.Write("*");
- }
- for (int j = 0; j < spaces; j++)
- {
- Console.Write(" ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement