Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace pool
- {
- class Program
- {
- static void Main(string[] args)
- {
- int V = int.Parse(Console.ReadLine());
- int pipe1 = int.Parse(Console.ReadLine());
- int pipe2 = int.Parse(Console.ReadLine());
- double H = double.Parse(Console.ReadLine());
- double pipe1Fullliters = pipe1 * H;
- double pipe2Fullliters = pipe2 * H;
- double litersFull = pipe1Fullliters + pipe2Fullliters;
- double percFull = litersFull / V * 100;
- if (percFull <= V)
- {
- Console.WriteLine($"The pool is {percFull:F2}% full. Pipe 1: {pipe1Fullliters/ litersFull * 100:F2}%. Pipe 2: {pipe2Fullliters/ litersFull * 100:F2}%.");
- }
- else
- {
- Console.WriteLine($"For {H:F2} hours the pool overflows with {(litersFull - V):F2} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment