Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class ThreeBrothers
- {
- public static void Main()
- {
- var firstBrTime = double.Parse(Console.ReadLine());
- var secondBrTime = double.Parse(Console.ReadLine());
- var thirdBrTime = double.Parse(Console.ReadLine());
- var fishingTime = double.Parse(Console.ReadLine());
- var totalTime = 1 / (1 / firstBrTime + 1 / secondBrTime + 1 / thirdBrTime);
- var restTime = totalTime * 0.15;
- var cleaningTime = totalTime + restTime;
- var timeLeft = fishingTime - cleaningTime;
- Console.WriteLine($"Cleaning time: {cleaningTime:F2}");
- if (timeLeft > 0)
- {
- Console.WriteLine($"Yes, there is a surprise - time left -> {Math.Floor(timeLeft)} hours.");
- }
- else // timeLeft <= 0
- {
- Console.WriteLine($"No, there isn't a surprise - shortage of time -> {Math.Ceiling(Math.Abs(timeLeft))} hours.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement