Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace PipesInBasin
- {
- class Program
- {
- static void Main()
- {
- var vol = int.Parse(Console.ReadLine());
- var debit1 = int.Parse(Console.ReadLine());
- var debit2 = int.Parse(Console.ReadLine());
- var hours = double.Parse(Console.ReadLine());
- double kol = debit1 * hours + debit2 * hours;
- if (vol >= kol)
- {
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.",
- Math.Floor(kol /vol*100), Math.Floor(debit1 * hours / kol * 100), Math.Floor(debit2 * hours / kol * 100));
- }
- else
- {
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.",
- hours, kol - vol);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement