Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp_10
- {
- 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 = Math.Floor(tryba1 / zapylnen * 100);//премахване на десетичната част
- var zapylnenPercent2 = Math.Floor(tryba2 / zapylnen * 100);//премахване на десетичната част
- var zapylnenPercent = Math.Floor(zapylnen / obem * 100);//премахване на десетичната част
- if (obem >= zapylnen)
- {
- Console.WriteLine($"The pool is {zapylnenPercent}% full. Pipe 1: {zapylnenPercent1}%. Pipe 2: {zapylnenPercent2}%.");
- }
- else // това е излишно if (obem < zapylnen)
- {
- double gornitsa = zapylnen - obem;
- Console.WriteLine($"For {hours} hours the pool overflows with {gornitsa:f1} liters.");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment