Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp10
- {
- class Program
- {
- static void Main(string[] args)
- {
- var obem = int.Parse(Console.ReadLine());
- var debit1 = int.Parse(Console.ReadLine());
- var debit2 = int.Parse(Console.ReadLine());
- var hours = double.Parse(Console.ReadLine());
- var tryba1 = hours * debit1;
- var tryba2 = hours * debit2;
- var zapylnen = tryba1 + tryba2;
- var zapylnenPercent1 = tryba1 / zapylnen * 100;
- var zapylnenPercent2 = tryba2 / zapylnen * 100;
- var zapylnenPercent = zapylnen / obem * 100;
- if (obem >= zapylnen)
- {
- Console.WriteLine($"The pool is {zapylnenPercent.ToString("0")}% full. Pipe 1: {Math.Floor(zapylnenPercent1)}%. Pipe 2: {Math.Floor(zapylnenPercent2)}%.");
- }
- else if (obem < zapylnen)
- {
- var gornitsa = zapylnen - obem;
- Console.WriteLine($"For {hours} hours the pool overflows with {gornitsa.ToString("0.0")} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement