Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ThreeBrothers
- {
- class Program
- {
- static void Main(string[] args)
- {
- double firstTime = double.Parse(Console.ReadLine());
- double secondTime = double.Parse(Console.ReadLine());
- double thirdTime = double.Parse(Console.ReadLine());
- double fatherTime = double.Parse(Console.ReadLine());
- double cleaningTime = 1 / (1 / firstTime + 1 / secondTime + 1 / thirdTime) * 1.15;
- double timeLeft = fatherTime - cleaningTime;
- Console.WriteLine($"Cleaning time: {cleaningTime:f2}");
- if (timeLeft > 0)
- {
- Console.WriteLine($"Yes, there is a surprise - time left -> {Math.Floor(timeLeft)} hours.");
- }
- else
- {
- 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