Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace practive
- {
- class Program
- {
- public static void Main(string[] args)
- {
- int vol = int.Parse(Console.ReadLine());
- int p1 = int.Parse(Console.ReadLine());
- int p2 = int.Parse(Console.ReadLine());
- double hours = double.Parse(Console.ReadLine());
- double volUsed = (hours * (p1 + p2));
- double percentFull = (volUsed / vol * 100);
- double percentP1 = Math.Truncate((p1 * hours / volUsed) * 100);
- double percentP2 = Math.Truncate((p2 * hours / volUsed) * 100);
- if (vol >= volUsed)
- {
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", percentFull, percentP1, percentP2);
- }
- else
- {
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.", hours, (volUsed - vol));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment