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