Advertisement
plamen27

Trubi v basein fixed

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