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 _02.PoolPipes_Exam26._03._2016
- {
- class PoolPipes
- {
- static void Main(string[] args)
- {
- double poolVolume = double.Parse(Console.ReadLine());
- double firstPipeDebit = double.Parse(Console.ReadLine());
- double secondPipeDebit = double.Parse(Console.ReadLine());
- double missingHoursWorker = double.Parse(Console.ReadLine());
- double totalDebit = (firstPipeDebit + secondPipeDebit) * missingHoursWorker;
- if (poolVolume >= totalDebit)
- {
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", Math.Truncate((totalDebit / poolVolume) * 100),
- Math.Truncate((firstPipeDebit * missingHoursWorker) / totalDebit * 100), Math.Truncate((secondPipeDebit * missingHoursWorker) / totalDebit * 100));
- }
- else if (poolVolume < totalDebit)
- {
- Console.WriteLine("For {0} hours the pool overflows with {1:f1} liters.", missingHoursWorker, totalDebit - poolVolume);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement