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)
- {
- var firstBrother = double.Parse(Console.ReadLine());
- var secondBrother = double.Parse(Console.ReadLine());
- var thirdBrother = double.Parse(Console.ReadLine());
- var fishingTime = double.Parse(Console.ReadLine());
- double totalTime = 1 / (1 / firstBrother + 1 / secondBrother + 1 / thirdBrother);
- totalTime += totalTime*0.15;
- Console.WriteLine($"Cleaning time: {totalTime:f2}");
- if (totalTime >= fishingTime)
- {
- Console.WriteLine($"No, there isn't a surprise - shortage of time -> {Math.Floor(fishingTime-totalTime)*-1} hours.");
- }
- else
- {
- Console.WriteLine($"Yes, there is a surprise - time left -> {Math.Ceiling(totalTime-fishingTime)*-1} hours.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment