Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int numberOfRestDays = int.Parse(Console.ReadLine());
- double normForPlayingPerYear = 30000;
- double daysInOneYear = 365;
- double restDaysPlayingTime = numberOfRestDays * 127;
- double workingDays = daysInOneYear - numberOfRestDays;
- double workingDaysPlayingTime = workingDays * 63;
- double TotalPlayingTimeInMinutes = workingDaysPlayingTime + restDaysPlayingTime;
- double restPlayingTime = normForPlayingPerYear - TotalPlayingTimeInMinutes;
- double restPlayingTimeHours = Math.Floor(Math.Abs(restPlayingTime / 60));
- double restPlayingTimeMinutes = Math.Abs(restPlayingTime % 60);
- if (normForPlayingPerYear > TotalPlayingTimeInMinutes)
- {
- Console.WriteLine("Tom sleeps well");
- Console.WriteLine($"{restPlayingTimeHours} hours and {restPlayingTimeMinutes} minutes less for play");
- }
- else
- {
- Console.WriteLine("Tom will run away");
- Console.WriteLine($"{restPlayingTimeHours} hours and {restPlayingTimeMinutes} minutes more for play");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement