guilpter

Untitled

Apr 22nd, 2019
56
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace christmastree
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = 1 + int.Parse(Console.ReadLine());
  14. for (int i = 1; i <=n; i++ )
  15. {
  16. var spaces = n - i;
  17. for (int j = 0; j < spaces; j++ )
  18. {
  19. Console.Write(" ");
  20. }
  21.  
  22. var asterix = i - 1;
  23. for (int j = 0; j < asterix; j++ )
  24. {
  25. Console.Write("*");
  26. }
  27. Console.Write(" | ");
  28.  
  29. for (int j = 0; j < asterix; j++)
  30. {
  31. Console.Write("*");
  32. }
  33.  
  34. for (int j = 0; j < spaces; j++)
  35. {
  36. Console.Write(" ");
  37. }
  38.  
  39. Console.WriteLine();
  40.  
  41. }
  42.  
  43. }
  44. }
  45. }
RAW Paste Data