Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace PipesInPool
- {
- class Program
- {
- static void Main(string[] args)
- {
- int v = int.Parse(Console.ReadLine());
- int p1 = int.Parse(Console.ReadLine());
- int p2 = int.Parse(Console.ReadLine());
- double h = double.Parse(Console.ReadLine());
- double vp1 = p1 * h;
- double vp2 = p2 * h;
- double vp1p2 = vp1 + vp2;
- if (v > vp1p2)
- {
- double v3 = (vp1p2 / v) * 100;
- double v3p1 = (vp1 / vp1p2) * 100;
- double v3p2 = (vp2 / vp1p2) * 100;
- Console.WriteLine($"The pool is {v3:F2}% full. Pipe 1: {v3p1:F2}%. Pipe 2: {v3p2:F2}%.");
- }
- else
- {
- double v4 = vp1p2 - v;
- Console.WriteLine($"For {h:F2} hours the pool overflows with {v4:F2} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement