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 _01.Day_of_Week
- {
- class Program
- {
- static void Main(string[] args)
- {
- var V = int.Parse(Console.ReadLine());
- var P1 = int.Parse(Console.ReadLine());
- var P2 = int.Parse(Console.ReadLine());
- var H = double.Parse(Console.ReadLine());
- var volumeWater = 0d;
- var FilledOne = 0d;
- var FilledTwo = 0d;
- var FilledPool = 0d;
- if (V >= P1 * H + P2 * H)
- {
- volumeWater = (H * P1) + (H * P2);
- FilledOne = ((P1 * H) / volumeWater) * 100;
- FilledTwo = ((P2 * H) / volumeWater) * 100;
- FilledPool = (volumeWater / V) * 100;
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", Math.Floor(FilledPool), Math.Floor(FilledOne), Math.Floor(FilledTwo));
- }
- else
- {
- FilledOne = P1 * H;
- FilledTwo = P2 * H;
- FilledPool = (FilledOne + FilledTwo) - V;
- Console.WriteLine("For {0} hours the pool overflows with {1} liters.", H, FilledPool);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment