Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Three_Brothers
- {
- class Program
- {
- static void Main(string[] args)
- {
- double brother1 = double.Parse(Console.ReadLine());
- double brother2 = double.Parse(Console.ReadLine());
- double brother3 = double.Parse(Console.ReadLine());
- double timeAvail = double.Parse(Console.ReadLine());
- double totalTime = 1 / (1 / brother1 + 1 / brother2 + 1 / brother3);
- totalTime += totalTime * 0.15;
- Console.WriteLine($"Cleaning time: {totalTime:f2}");
- double timeLeft = timeAvail - totalTime;
- if(timeLeft > 0)
- {
- Console.WriteLine($"Yes, there is a surprise - time left -> {Math.Floor(timeLeft)} hours.");
- }
- else
- {
- double diff = totalTime - timeAvail;
- Console.WriteLine($"No, there isn't a surprise - shortage of time -> {Math.Ceiling(diff)} hours.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement