Advertisement
VickSuna

Untitled

Mar 1st, 2020
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _4291_Volleyball
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string year = Console.ReadLine();
  10. int holidays = int.Parse(Console.ReadLine());
  11. int numWeekendsAtHome = int.Parse(Console.ReadLine());
  12.  
  13. double totalWeekends = 48;
  14.  
  15. double weekendsInSofia = totalWeekends - numWeekendsAtHome;
  16. double playsInSofia = weekendsInSofia * 1.0 * 3 / 4;
  17. double playsInHomeTown = numWeekendsAtHome;
  18. double playsInHolidays = holidays * 1.0 * 2 / 3;
  19.  
  20. double totalPlays = playsInSofia + playsInHomeTown + playsInHolidays;
  21.  
  22. if (year == "leap")
  23. {
  24. totalPlays = (totalPlays + (totalPlays * 0.15));
  25. }
  26.  
  27. Console.WriteLine($"{Math.Floor (totalPlays)}");
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement