Advertisement
bullit3189

Christmas Spirit TF-MidExam 18Dec18

Jan 26th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _01ChristmasSpirit
  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. int spentMoney = 0;
  12. int christmasSpirit = 0;
  13.  
  14. for (int currDay = 1; currDay <= days; currDay++)
  15. {
  16. if (currDay%11==0)
  17. {
  18. quantity += 2;
  19. }
  20. if (currDay%2==0)
  21. {
  22. spentMoney += 2 * quantity;
  23. christmasSpirit += 5;
  24. }
  25. if (currDay%3==0)
  26. {
  27. spentMoney += 5 * quantity;
  28. spentMoney += 3 * quantity;
  29. christmasSpirit += 13;
  30. }
  31. if (currDay%5==0)
  32. {
  33. spentMoney += 15 * quantity;
  34. christmasSpirit += 17;
  35.  
  36. if (currDay%3==0)
  37. {
  38. christmasSpirit += 30;
  39. }
  40. }
  41. if (currDay%10==0)
  42. {
  43. christmasSpirit -= 20;
  44. spentMoney += 5 + 3 + 15;
  45.  
  46. if(currDay%10==0 && currDay==days)
  47. {
  48. christmasSpirit -= 30;
  49. }
  50. }
  51. }
  52.  
  53. Console.WriteLine("Total cost: {0}",spentMoney);
  54. Console.WriteLine("Total spirit: {0}",christmasSpirit);
  55.  
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement