Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _1.Volleyball
- {
- using System;
- public class Volleyball
- {
- private const int WeekendsOnYear = 48;
- public static void Main(string[] args)
- {
- checked
- {
- string year = Console.ReadLine();
- int holidaysP = int.Parse(Console.ReadLine());
- int hometownWeekendsH = int.Parse(Console.ReadLine());
- // Calculate playing days of weekends, when Vladi goes at his hometown:
- double playingDays = hometownWeekendsH;
- // Calculate playing days of normal weekends, when Vladi is not work and adds to calculated result above:
- playingDays += (WeekendsOnYear - hometownWeekendsH) * 3d / 4d;
- // Calculate playing days of holidays and adds to all calculated result above:
- playingDays += holidaysP * 2d / 3d;
- // Finally, if given year is Leap, will must addition result with 15%:
- if (year == "leap")
- {
- playingDays *= 1.15;
- }
- // Rounding to down and print result:
- int totalPlayDays = (int)playingDays;
- Console.WriteLine(totalPlayDays);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement