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 ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- double volume = double.Parse(Console.ReadLine());
- double pipe1= double.Parse(Console.ReadLine());
- double pipe2 = double.Parse(Console.ReadLine());
- double hours = double.Parse(Console.ReadLine());
- double volumePipe1 = pipe1 * hours;
- double volumePipe2 = pipe2 * hours;
- double volumePipes = volumePipe1 + volumePipe2;
- double volumeProcent = volumePipes/ 100.0;
- double volumePipe1Procent =volumePipe1/volumeProcent;
- double volumePipe2Procent =volumePipe2/volumeProcent;
- double volume1Procen = volume / 100.0;
- double volumePoolProcent = volumePipes / volume1Procen;
- if (volumePipes < volume)
- {
- Console.WriteLine("The pool is " + Math.Floor(volumePoolProcent) + '%' +
- " full." + " Pipe 1: " + Math.Floor(volumePipe1Procent) + "%." +
- " Pipe 2: " + Math.Floor(volumePipe2Procent) + "%.");
- }
- else if (volumePipes > volume)
- {
- double volumeOut = (volumePipes- volume);
- Console.WriteLine("For " + hours + " hours the pool overflows with " +
- (volumeOut) + " liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement