Advertisement
kzborisov

PoopPipes

Sep 22nd, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Pool_Pipes
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int volume = int.Parse(Console.ReadLine());
  14. int pipe1 = int.Parse(Console.ReadLine());
  15. int pipe2 = int.Parse(Console.ReadLine());
  16. double hours = double.Parse(Console.ReadLine());
  17.  
  18. double water = (pipe1 * hours) + (pipe2 * hours);
  19.  
  20. if (water <= volume)
  21. {
  22. Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%",
  23. Math.Truncate((water / volume) * 100),
  24. Math.Truncate(pipe1 * hours / water * 100),
  25. Math.Truncate(pipe2 * hours / water * 100));
  26. }
  27. else
  28. {
  29. Console.WriteLine("For {0} hours the pool overflows with {1} liters.",
  30. hours, water - volume);
  31. }
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement