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