Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApplication16
- {
- 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 litersOP1 = p1 * h;
- var litersOP2 = p2 * h;
- var allLiters = litersOP1 + litersOP2;
- var percentAll = (allLiters / v) * 100;
- var percent1 = (litersOP1 / allLiters) * 100;
- var percent2 = (litersOP2 / allLiters) * 100;
- if (v > allLiters)
- {
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.",(int)percentAll,(int)percent1,(int)percent2);
- }
- else
- {
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.", h, Math.Abs(allLiters - v));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement