Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Тръби_в_басейн
- {
- 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());
- if (((P1 + P2) * H) < V)
- {
- Console.WriteLine($"The pool is {(int)(((P1 + P2) * H * 100) / V)}% full. Pipe 1: {(int)((P1 *100) / (P1 + P2))}%. Pipe 2: {(int)((P2 * 100) / (P1 + P2))}%.");
- }
- else
- {
- Console.WriteLine($"For {H} hours the pool overflows with {(((P1 + P2) * H) - V)} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment