Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Басейн
- {
- class Program
- {
- static void Main(string[] args)
- {
- int V = int.Parse(Console.ReadLine());
- int p1 = int.Parse(Console.ReadLine());
- int p2 = int.Parse(Console.ReadLine());
- double hours = double.Parse(Console.ReadLine());
- double litersP1 = (p1 * hours);
- double litersP2 = (p2 * hours);
- double V1 = (litersP2 + litersP1) / 10;
- double allPrecent = ((p1 + p2 )/ V )* 100;
- double precentP1 = (litersP1 / V1) * 10;
- double precentP2 = (litersP2 / V1) * 10;
- if (litersP1 + litersP2 <= V)
- {
- Console.WriteLine($"The pool is {V1}% full. Pipe 1: {precentP1:f2}%. Pipe 2: {precentP2:f2}%. ");
- }
- else
- {
- Console.WriteLine($"For {hours:f2} hours the pool overflows with {(litersP1 + litersP2) - V:f2} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment