Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Pulbs_in_pool
- {
- class Program
- {
- static void Main(string[] args)
- {
- var v =int.Parse(Console.ReadLine());
- var p1 = int.Parse(Console.ReadLine());
- var p2 = int.Parse(Console.ReadLine());
- var h = Double.Parse(Console.ReadLine());
- var bothPipe = (p1 * h) + (p2 * h);
- if (v >= (p1*h) + (p2*h))
- {
- var vPercent = (p1 * h) + (p2 * h);
- var vPercent1 = (vPercent / v) * 100;
- var p1Percent = (p1 * h) / bothPipe * 100;
- var p2Percent = (p2 * h) / bothPipe * 100;
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", (int)vPercent1, (int)p1Percent, (int)p2Percent);
- }
- else
- {
- var overflow = bothPipe - v;
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.", h, overflow);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement