Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace PipesInPool
- {
- class Program
- {
- static void Main()
- {
- double volume = double.Parse(Console.ReadLine());
- double pipe1 = double.Parse(Console.ReadLine());
- double pipe2 = double.Parse(Console.ReadLine());
- double hour = double.Parse(Console.ReadLine());
- double poolV = (pipe1 + pipe2) * hour;
- double poolP = poolV / volume;
- if (volume >= poolV)
- {
- Console.WriteLine($"The pool is {poolP * 100:F2}% full. Pipe 1: " +
- $"{pipe1 / poolV * hour * 100:F2}%. Pipe 2: {pipe2 / poolV * hour * 100:F2}%.");
- }
- else
- {
- Console.WriteLine($"For {hour} hours the pool overflows with {poolV - volume:F2} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement