Advertisement
Guest User

Pipes

a guest
Dec 4th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 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 Pipes
  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 Hours = double.Parse(Console.ReadLine());
  17. double DebitP1 = P1 * Hours;
  18. double DebitP2 = P2 * Hours;
  19. double DebitP1andP2 = DebitP1 + DebitP2;
  20. double percentagep1=((DebitP1/DebitP1andP2)*100);
  21. double percentagep2=((DebitP2/DebitP1andP2)*100);
  22. double percentageP1andP2=(((DebitP1+DebitP2)/V)*100);
  23. if (DebitP1andP2<=V)
  24. {
  25. Console.WriteLine("The pool is {0:f0}% full. Pipe 1: {1:f0}%. Pipe 2: {2:f0}%.",
  26. percentageP1andP2,percentagep1,percentagep2);
  27.  
  28. }
  29. else
  30. {
  31. Console.WriteLine("For {0} hours the pool overflows with {1} liters.", Hours, (DebitP1andP2-V));
  32. }
  33.  
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement