Advertisement
sivancheva

Untitled

Apr 29th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 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 = int.Parse(Console.ReadLine());
  14. var debitPipe1 = int.Parse(Console.ReadLine());
  15. var debitPipe2 = int.Parse(Console.ReadLine());
  16. var hours = double.Parse(Console.ReadLine());
  17.  
  18.  
  19. int pulnotaPool = (int)((debitPipe1 + debitPipe2) * hours);
  20. int pulnotaPoolProzent = pulnotaPool / volumePool * 100;
  21. int prinosPipe1 = (int)((debitPipe1 / (debitPipe1 + debitPipe2)) * 100);
  22. int prinosPipe2 = (int)((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