Advertisement
Guest User

Untitled

a guest
Jun 1st, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 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.  
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. double v = double.Parse(Console.ReadLine());
  13. double p1 = double.Parse(Console.ReadLine());
  14. double p2= double.Parse(Console.ReadLine());
  15. double h = double.Parse(Console.ReadLine());
  16. double first = h * p1;
  17. double second = h * p2;
  18. double sum = first + second;
  19. double obem =Math.Truncate( sum * 100 / v);
  20. double trabaone = Math.Truncate( first * 100 / sum);
  21. double trabatwo =Math.Truncate (second * 100 / sum);
  22. double other = sum - v;
  23. if (sum <= v)
  24. {
  25. Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", obem,trabaone,trabatwo);
  26.  
  27. }
  28. else
  29. Console.WriteLine("For {0} hours the pool overflows with {1} liters.",h,other);
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement