Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 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 Choinka
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int d, e, f, g, h, i;
  14. string a, b,c;
  15. Console.WriteLine("Podaj wysokosc choinki: ");
  16. g = int.Parse(Console.ReadLine());
  17. a = "*";
  18. b = " ";
  19. c = "|";
  20. d = g;
  21. for (e = 1; e <= g; e++)
  22. {
  23. for (f = 1; f < d; f++)
  24. {
  25. Console.Write(b);
  26. }
  27. for (h = 1; h <= e; h++)
  28. {
  29. Console.Write(a);
  30. }
  31. for (i = 1; i <= e - 1; i++)
  32. {
  33. Console.Write(a);
  34. }
  35. d--;
  36. Console.WriteLine();
  37. }
  38. for (e = 1; e <= g-1 ; e++)
  39. {
  40. Console.Write(b);
  41.  
  42. }
  43. Console.Write(c);
  44.  
  45. Console.WriteLine();
  46. for (e = 1; e <= g - 1; e++)
  47. {
  48. Console.Write(b);
  49.  
  50. }
  51. Console.Write(c);
  52.  
  53.  
  54. Console.ReadKey();
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement