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 More_Pipes_In_Pool
- {
- class Program
- {
- static void Main(string[] args)
- {
- double volume = double.Parse(Console.ReadLine());
- double debitOne = double.Parse(Console.ReadLine());
- double debitTwo = double.Parse(Console.ReadLine());
- double hours = double.Parse(Console.ReadLine());
- double pipeOneFulling = hours * debitOne;
- double pipeTwoFulling = hours * debitTwo;
- double pipesFullingSum = pipeOneFulling + pipeTwoFulling;
- if (pipesFullingSum <= volume)
- {
- double chekingForPracent = pipesFullingSum / volume * 100;//така се намират проценти 660 сумата делим на обема и умножаваме по 100
- double pracentForOnePipe =Math.Floor( pipeOneFulling / pipesFullingSum * 100);// namirane na procentite na kolichestvoto voda napulneno ot edna traba
- double parcentForTwoPipe =Math.Floor( pipeTwoFulling / pipesFullingSum * 100);
- Console.WriteLine($"The pool is {chekingForPracent}% full. Pipe 1: {pracentForOnePipe}%. Pipe 2: {parcentForTwoPipe}%.");
- }
- else
- {
- Console.WriteLine($"For {hours:F2} hours the pool overflows with {pipesFullingSum:F2} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement