Advertisement
YankoGrancharov

trabi

May 29th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. import math
  2. obem = int(input())
  3. tr1 = int(input())
  4. tr2 = int(input())
  5. vreme = float(input())
  6. deb1 = tr1*vreme
  7. deb2 = tr2*vreme
  8. debit = deb1+deb2
  9. obemprocent = math.trunc((debit*100)/obem)
  10. tr1procent = math.trunc((deb1*100)/debit)
  11. tr2procent = math.trunc((deb2*100)/debit)
  12. obemplus = float(debit-obem)
  13. if obemplus< obem:
  14.     print ("The pool is {0}% full. Pipe 1: {1}%. Pipe 2: {2}%.".format(round(obemprocent),round(tr1procent),round(tr2procent)))
  15.    
  16. if obemplus>=obem:
  17.     print ("For {0} hours the pool overflows with {1} liters.".format(vreme,obemplus))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement