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 ConsoleApp4
- {
- class Program
- {
- static void Main(string[] args)
- {
- int volumeInLitres = int.Parse(Console.ReadLine());
- int pipe1 = int.Parse(Console.ReadLine());
- int pipe2 = int.Parse(Console.ReadLine());
- double hours = double.Parse(Console.ReadLine());
- double litresForHours = (pipe1 + pipe2) * hours;
- double percentLitres = litresForHours / volumeInLitres * 100;
- double percentPipe1 = pipe1 * hours / litresForHours * 100;
- double percentPipe2 = pipe2 * hours / litresForHours * 100;
- if (volumeInLitres >= litresForHours)
- {
- Console.WriteLine($"The pool is {percentLitres:F2}% full. Pipe 1: {percentPipe1:F2}%. Pipe 2: {percentPipe2:F2}%.");
- }
- else
- {
- Console.WriteLine($"For {hours:f2} hours the pool overflows with {litresForHours - volumeInLitres:F2} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement