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 pool_pipe
- {
- 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());
- var liter = P1 * H + P2 * H;
- if (liter <= V)
- {
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", Math.Truncate(100 * liter / V), Math.Truncate(100 * P1 * H / liter), Math.Truncate(100 * P2 * H / liter));
- }
- else
- {
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.", H, (liter - V));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement