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 LiveDemo2
- {
- class Program
- {
- static void Main(string[] args)
- {
- // • Първият ред съдържа числото V – Обем на басейна в литри – цяло число в интервала[1…10000].
- //• Вторият ред съдържа числото P1 – дебит на първата тръба за час – цяло число в интервала[1…5000].
- //• Третият ред съдържа числото P2 – дебит на втората тръба за час– цяло число в интервала[1…5000].
- //• Четвъртият ред съдържа числото H – часовете които работникът отсъства – число с плаваща запетая в интервала[1.0…24.00]
- int poolVolume = int.Parse(Console.ReadLine());
- int firstPump = int.Parse(Console.ReadLine());
- int secondPump = int.Parse(Console.ReadLine());
- double hoursWorkerIsNotArount = double.Parse(Console.ReadLine());
- double firstPumpPumped = firstPump * hoursWorkerIsNotArount;
- double secondPumpPumped = secondPump * hoursWorkerIsNotArount;
- double twoPumpsPumped = firstPumpPumped + secondPumpPumped;
- if (twoPumpsPumped <= poolVolume)
- {
- int poolPercentFul = (int)(twoPumpsPumped / poolVolume * 100);
- int firstPipePercent = (int)(firstPumpPumped / twoPumpsPumped * 100);
- int secondPipePercent = (int)(secondPumpPumped / twoPumpsPumped * 100);
- Console.WriteLine($"The pool is {poolPercentFul}% full. Pipe 1: {firstPipePercent}%. Pipe 2: {secondPipePercent}%.");
- }
- else
- {
- double litersOverflow = Math.Abs(poolVolume - twoPumpsPumped);
- Console.WriteLine($"For {hoursWorkerIsNotArount} hours the pool overflows with {litersOverflow} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment