Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace tESt
- {
- class Program
- {
- static void Main(string[] args)
- {
- double pool = double.Parse(Console.ReadLine());
- double pipe1 = double.Parse(Console.ReadLine());
- double pipe2 = double.Parse(Console.ReadLine());
- double time = double.Parse(Console.ReadLine());
- var capacityPipe1 = pipe1 * time;
- var capacityPipe2 = pipe2 * time;
- var capacityPipe1and2 = capacityPipe1 + capacityPipe2;
- var pro1 = Math.Round(capacityPipe1 / (capacityPipe1and2 / 100),0);
- var pro2 = Math.Round(capacityPipe2 / (capacityPipe1and2 / 100),0);
- var poolProcentage = capacityPipe1and2 / (pool / 100);
- var overFlows = capacityPipe1and2 - pool;
- if (capacityPipe1and2 < pool)
- {
- Console.WriteLine($"The pool is {poolProcentage}% full. Pipe 1: {pro1}%. Pipe 2: {pro2}%.");
- }
- else if (capacityPipe1and2 > pool)
- {
- Console.WriteLine($"For {time} hours the pool overflows with {overFlows:0.0} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement