Advertisement
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()),
- P1 = int.Parse(Console.ReadLine()),
- P2 = int.Parse(Console.ReadLine());
- double H = double.Parse(Console.ReadLine());
- double V1 = P1 * H,
- V2 = P2 * H;
- if (V1 + V2 <= V)
- {
- int x = (int)((V1 + V2) * 100.0 / V),
- y = (int)(V1 * 100.0 / (V1 + V2)),
- z = (int)(V2 * 100.0 / (V1 + V2));
- Console.WriteLine($"The pool is {x}% full. Pipe 1: {y}%. Pipe 2: {z}%.");
- }
- else
- {
- Console.WriteLine($"For {H} hours the pool overflows with {V1 + V2 - V:F1} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement