Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Three_brothers
- {
- class Program
- {
- static void Main(string[] args)
- {
- double timeA = double.Parse(Console.ReadLine());
- double timeB = double.Parse(Console.ReadLine());
- double timeC = double.Parse(Console.ReadLine());
- double timeD = double.Parse(Console.ReadLine());
- double workTime = ((1 / ((1 / timeA) + (1 / timeB) + (1 / timeC))) * 1.15);
- double timeLeft = timeD-workTime;
- if (timeLeft > 0)
- {
- Console.WriteLine($"Cleaning time: {workTime:f2}");
- timeLeft = Math.Floor(timeD-workTime);
- Console.WriteLine($"Yes, there is a surprise - time left -> {timeLeft} hours.");
- }
- else
- {
- Console.WriteLine($"Cleaning time: {workTime:f2}");
- double timeLeft1 = Math.Ceiling(Math.Abs(timeD-workTime));
- Console.WriteLine($"No, there isn't a surprise - shortage of time -> {timeLeft1} hours.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement