Advertisement
pacho_the_python

Untitled

Jan 21st, 2022
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. num = int(input())
  2. current_litters = int(input())
  3.  
  4. total_litters = 0
  5. over_flow = 0
  6.  
  7. while True:
  8.  
  9.     total_litters += current_litters
  10.     over_flow += 1
  11.  
  12.     if total_litters > 255:
  13.         print("Insufficient capacity!")
  14.         total_litters -= current_litters
  15.  
  16.     if over_flow == num:
  17.         break
  18.     current_litters = int(input())
  19.  
  20. print(total_litters)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement