Advertisement
Spocoman

07. Water Overflow

Jan 19th, 2022
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. num = int(input())
  2. tank_liters = 0
  3.  
  4. for i in range(num):
  5.     current = int(input())
  6.     if tank_liters + current <= 255:
  7.         tank_liters += current
  8.     else:
  9.         print('Insufficient capacity!')
  10.  
  11. print(tank_liters)
  12.  
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement