Guest User

Untitled

a guest
Jun 10th, 2019
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. using System;
  2.  
  3. namespace pool
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int V = int.Parse(Console.ReadLine());
  10. int pipe1 = int.Parse(Console.ReadLine());
  11. int pipe2 = int.Parse(Console.ReadLine());
  12. double H = double.Parse(Console.ReadLine());
  13. double pipe1Fullliters = pipe1 * H;
  14. double pipe2Fullliters = pipe2 * H;
  15. double litersFull = pipe1Fullliters + pipe2Fullliters;
  16. double percFull = litersFull / V * 100;
  17. if (percFull <= V)
  18. {
  19. Console.WriteLine($"The pool is {percFull:F2}% full. Pipe 1: {pipe1Fullliters/ litersFull * 100:F2}%. Pipe 2: {pipe2Fullliters/ litersFull * 100:F2}%.");
  20. }
  21. else
  22. {
  23. Console.WriteLine($"For {H:F2} hours the pool overflows with {(litersFull - V):F2} liters.");
  24. }
  25.  
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment