bullit3189

Party Profit - TF MidExam 4Nov18

Jan 26th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _01PartyProfit
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. long partySize = long.Parse(Console.ReadLine());
  10. long days = long.Parse(Console.ReadLine());
  11.  
  12. double coins = 0;
  13.  
  14. for (int currDay = 1; currDay <= days; currDay++)
  15. {
  16.  
  17. if (currDay % 10 == 0)
  18. {
  19. partySize -= 2;
  20. }
  21.  
  22. if (currDay % 15 == 0)
  23. {
  24. partySize += 5;
  25. }
  26.  
  27. coins += 50;
  28. coins -= (partySize * 2);
  29.  
  30. if (currDay%3==0)
  31. {
  32. coins -= partySize * 3;
  33. }
  34.  
  35. if (currDay%5==0)
  36. {
  37. coins += partySize * 20;
  38.  
  39. if (currDay%3==0)
  40. {
  41. coins -= partySize * 2;
  42. }
  43. }
  44.  
  45. }
  46.  
  47. double coinsPerPerson =Math.Floor( coins / partySize);
  48. Console.WriteLine($"{partySize} companions received {coinsPerPerson} coins each.");
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment