Advertisement
Spocoman

07. Moving

Dec 27th, 2021 (edited)
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. width = int(input())
  2. length = int(input())
  3. height = int(input())
  4.  
  5. cubic_meters = width * length * height
  6.  
  7. while True:
  8.     command = input()
  9.     if command == "Done":
  10.         print(f'{cubic_meters} Cubic meters left.')
  11.         break
  12.     cubic_meters -= int(command)
  13.     if cubic_meters <= 0:
  14.         print(f'No more free space! You need {abs(cubic_meters)} Cubic meters more.')
  15.         break
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement