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 pool
- {
- class Program
- {
- static void Main(string[] args)
- {
- int V = int.Parse(Console.ReadLine());
- int P1 = int.Parse(Console.ReadLine());
- int P2 = int.Parse(Console.ReadLine());
- double H =double.Parse(Console.ReadLine());
- double totalV = Math.Truncate((P1 + P2) * H);
- double fullPool =Math.Truncate( (totalV / V) * 100);
- double P11 =Math.Truncate( ((P1 * H) / totalV)*100);
- double P22 =Math.Truncate( ((P2 * H) / totalV) * 100);
- double overflows =totalV-V;
- if (totalV<V)
- {
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.",fullPool,P11,P22);
- }
- else if (totalV>V)
- {
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.",H,overflows);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement