zh_stoqnov

Volleyball

Oct 24th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Volleyball
  4. {
  5. class Volleyball
  6. {
  7. public static void Main(string[] args)
  8. {
  9. string leap = Console.ReadLine();
  10. int p = int.Parse(Console.ReadLine());
  11. int h = int.Parse(Console.ReadLine());
  12. double weekends = 48;
  13. double hometownPlays = (double)h;
  14. double normalPlays = (double)((weekends - hometownPlays) * 3) / 4;
  15. double holidayPlays = (double)(((double)p * 2) / 3);
  16. double allPlays = hometownPlays + normalPlays + holidayPlays;
  17. int allPlaysRounded = (int)allPlays;
  18. double allPlaysLeap = allPlays + (allPlays * 0.15);
  19. int allPlaysLeapRounded = (int)allPlaysLeap;
  20. if(leap == "leap")
  21. {
  22. Console.WriteLine(allPlaysLeapRounded);
  23. }
  24. else
  25. {
  26. Console.WriteLine(allPlaysRounded);
  27. }
  28.  
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment