Guest User

Untitled

a guest
Sep 11th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 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 _01.Day_of_Week
  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. var volumeWater = 0d;
  18. var FilledOne = 0d;
  19. var FilledTwo = 0d;
  20. var FilledPool = 0d;
  21. if (V >= P1 * H + P2 * H)
  22. {
  23. volumeWater = (H * P1) + (H * P2);
  24. FilledOne = ((P1 * H) / volumeWater) * 100;
  25. FilledTwo = ((P2 * H) / volumeWater) * 100;
  26. FilledPool = (volumeWater / V) * 100;
  27. Console.WriteLine("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.", Math.Floor(FilledPool), Math.Floor(FilledOne), Math.Floor(FilledTwo));
  28. }
  29. else
  30. {
  31. FilledOne = P1 * H;
  32. FilledTwo = P2 * H;
  33. FilledPool = (FilledOne + FilledTwo) - V;
  34. Console.WriteLine("For {0} hours the pool overflows with {1} liters.", H, FilledPool);
  35.  
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment