Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 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
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int V = int.Parse(Console.ReadLine());
  14. int P1 = int.Parse(Console.ReadLine());
  15. int P2 = int.Parse(Console.ReadLine());
  16. double H =double.Parse(Console.ReadLine());
  17. double totalV = Math.Truncate((P1 + P2) * H);
  18. double fullPool =Math.Truncate( (totalV / V) * 100);
  19. double P11 =Math.Truncate( ((P1 * H) / totalV)*100);
  20. double P22 =Math.Truncate( ((P2 * H) / totalV) * 100);
  21. double overflows =totalV-V;
  22.  
  23. if (totalV<V)
  24. {
  25. Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.",fullPool,P11,P22);
  26. }
  27. else if (totalV>V)
  28. {
  29. Console.WriteLine("For {0} hours the pool overflows with {1} liters.",H,overflows);
  30. }
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement