Advertisement
sivancheva

Untitled

Apr 29th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 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 pipesInPool
  8. {
  9. class pipesInPool
  10. {
  11. static void Main(string[] args)
  12. {
  13. var volumePool = double.Parse(Console.ReadLine());
  14. var debitPipe1 = double.Parse(Console.ReadLine());
  15. var debitPipe2 = double.Parse(Console.ReadLine());
  16. var hours = double.Parse(Console.ReadLine());
  17.  
  18.  
  19. var pulnotaPool = (debitPipe1 + debitPipe2)*hours;
  20. var pulnotaPoolProzent = pulnotaPool/volumePool*100;
  21. var prinosPipe1 = Math.Round((debitPipe1 / (debitPipe1+debitPipe2))*100);
  22. var prinosPipe2 = Math.Round((debitPipe2 / (debitPipe1 + debitPipe2))*100);
  23.  
  24. if (pulnotaPool <= volumePool)
  25. {
  26. Console.WriteLine( "The pool is {0}% full." +
  27. " Pipe 1: {1}%. Pipe 2: {2}%.", pulnotaPoolProzent, prinosPipe1, prinosPipe2);
  28. }
  29.  
  30. else if (pulnotaPool > volumePool)
  31. {
  32. var overflowsL = pulnotaPool - volumePool;
  33. Console.WriteLine("For {0} hours the pool overflows with {1} liters."
  34. ,hours, overflowsL);
  35. }
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement