Advertisement
spasnikolov131

Untitled

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