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 firstBrotherTime = double.Parse(Console.ReadLine());
- var secondBrotherTime = double.Parse(Console.ReadLine());
- var thirdBrotherTime = double.Parse(Console.ReadLine());
- var fatherOnFishing = double.Parse(Console.ReadLine());
- var allBrothersTimeSum = 1 / ((1 / firstBrotherTime) + (1 / secondBrotherTime) + (1 / thirdBrotherTime));
- var timeWithBreak = allBrothersTimeSum + (allBrothersTimeSum * 0.15);
- var timeLeft = fatherOnFishing - timeWithBreak;
- if (timeLeft > 0 && timeLeft < 100)
- {
- Console.WriteLine(string.Format("Cleaning time: " + (Math.Round(timeWithBreak, 2))));
- Console.WriteLine(string.Format("Yes, there is a surprise - time left -> " + timeLeft + "hours"));
- }
- else
- {
- Console.WriteLine(string.Format("Cleaning time: " + (Math.Round(timeWithBreak, 2))));
- Console.WriteLine(string.Format("No, there isn't a surprise - shortage of time - > " + (Math.Ceiling(timeLeft)) + "hours"));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment