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 Pipes
- {
- 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 Hours = double.Parse(Console.ReadLine());
- double DebitP1 = P1 * Hours;
- double DebitP2 = P2 * Hours;
- double DebitP1andP2 = DebitP1 + DebitP2;
- double percentagep1=((DebitP1/DebitP1andP2)*100);
- double percentagep2=((DebitP2/DebitP1andP2)*100);
- double percentageP1andP2=(((DebitP1+DebitP2)/V)*100);
- if (DebitP1andP2<=V)
- {
- Console.WriteLine("The pool is {0:f0}% full. Pipe 1: {1:f0}%. Pipe 2: {2:f0}%.",
- percentageP1andP2,percentagep1,percentagep2);
- }
- else
- {
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.", Hours, (DebitP1andP2-V));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement