Advertisement
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 Pipes_In_Pool
- {
- class Program
- {
- static void Main(string[] args)
- {
- double v = double.Parse(Console.ReadLine());
- double P1 = double.Parse(Console.ReadLine());
- double P2 = double.Parse(Console.ReadLine());
- double H = double.Parse(Console.ReadLine());
- double pipe1 = H * P1;
- double pipe2 = H * P2;
- double totalPipes = pipe1 + pipe2;
- double percentPool = (totalPipes / v) * 100;
- double percentPipe1 = (pipe1/totalPipes) * 100;
- double percentPipe2 = (pipe2 / totalPipes) * 100;
- if (totalPipes <= v)
- {
- Console.WriteLine($"The pool is {percentPool}% full. Pipe 1: {percentPipe1:f2}%. Pipe 2: {percentPipe2:f2}%.");
- }
- else
- {
- double over = totalPipes - v;
- Console.WriteLine($"For {H:f2} hours the pool overflows with {over:f2} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement