Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace tESt
- {
- class Program
- {
- static void Main(string[] args)
- {
- var brother_1 = double.Parse(Console.ReadLine()); // 3
- var brother_2 = double.Parse(Console.ReadLine()); // 4
- var brother_3 = double.Parse(Console.ReadLine()); // 5
- var fatherFishing = double.Parse(Console.ReadLine()); // 3.6
- var cleaningTime = 1 / ((1 / brother_1) + (1 / brother_2) + (1 / brother_3)) * 1.15; // 15%
- var leftHours = fatherFishing - cleaningTime;
- Console.WriteLine($"Cleaning time: {cleaningTime:f2}");
- if (leftHours >= 0)
- {
- leftHours = Math.Floor(leftHours);
- Console.WriteLine($"Yes, there is a surprise - time left -> {leftHours} hours.");
- }
- else
- {
- leftHours = Math.Abs(leftHours);
- leftHours = Math.Ceiling(leftHours);
- Console.WriteLine($"No, there isn't a surprise - shortage of time -> {leftHours} hours.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment