Sichanov

f

Jul 31st, 2021
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. width = int(input())
  2. length = int(input())
  3. height = int(input())
  4. free_space = width * length * height
  5. initial_space = free_space
  6. total_space = 0
  7. rest = 0
  8. command = input()
  9.  
  10. while command != "Done" and free_space - int(command) > 0:
  11.     boxes = int(command)
  12.     free_space -= boxes
  13.     command = input()
  14.  
  15. if command == 'Done':
  16.     print(f"{free_space} Cubic meters left.")
  17. else:
  18.     rest = abs(free_space - int(command))
  19.     print(f"No more free space! You need {rest} Cubic meters more.")
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment