petyaminkova91

Untitled

Oct 30th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _01_ChristmasSpirit
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int quantity = int.Parse(Console.ReadLine());
  10. int days = int.Parse(Console.ReadLine());
  11.  
  12. int ornamentSetPrice = 2;
  13. int treeSkirt = 5;
  14. int treeGarlands = 3;
  15. int treeLights = 15;
  16.  
  17. int totalPrice = 0;
  18. int christmasSpirit = 0;
  19.  
  20. for (int i = 1; i <= days; i++)
  21. {
  22.  
  23. if (i % 11 == 0)
  24. {
  25. quantity += 2;
  26. }
  27.  
  28. if (i % 2 == 0)
  29. {
  30. totalPrice += ornamentSetPrice * quantity;
  31. christmasSpirit += 5;
  32. }
  33.  
  34. if (i % 3 == 0)
  35. {
  36. totalPrice += quantity * (treeSkirt + treeGarlands);
  37. christmasSpirit += 13;
  38. }
  39.  
  40. if (i % 5 == 0)
  41. {
  42. totalPrice += quantity * treeLights;
  43. christmasSpirit += 17;
  44. }
  45.  
  46. if (i % 3 == 0 && i % 5 == 0)
  47. {
  48. christmasSpirit += 30;
  49. }
  50.  
  51. if (i % 10 == 0)
  52. {
  53. christmasSpirit -= 20;
  54. totalPrice += treeLights + treeSkirt + treeGarlands; // towa move i da ne vliza
  55. }
  56.  
  57. if (i % 10 == 0 && i == days)
  58. {
  59. christmasSpirit -= 30;
  60. }
  61.  
  62. }
  63.  
  64. Console.WriteLine($"Total cost: {totalPrice}");
  65. Console.WriteLine($"Total spirit: {christmasSpirit}");
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment