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;
- class Program
- {
- static void Main(string[] args)
- {
- double v = double.Parse(Console.ReadLine());
- double p1 = double.Parse(Console.ReadLine());
- double p2= double.Parse(Console.ReadLine());
- double h = double.Parse(Console.ReadLine());
- double first = h * p1;
- double second = h * p2;
- double sum = first + second;
- double obem =Math.Truncate( sum * 100 / v);
- double trabaone = Math.Truncate( first * 100 / sum);
- double trabatwo =Math.Truncate (second * 100 / sum);
- double other = sum - v;
- if (sum <= v)
- {
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", obem,trabaone,trabatwo);
- }
- else
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.",h,other);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement