Advertisement
desislava_topuzakova

09. Moving

Oct 10th, 2020
1,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. width = int(input())
  2. length = int(input())
  3. height = int(input())
  4.  
  5. #volume = count_free_space
  6. count_free_space = width * length * height
  7.  
  8. command = input() #брой пренесени кашони или текстът "Done"
  9. # спираме => command == Done
  10. # продължаваме -> command != Done
  11.  
  12. while command != "Done":
  13.     # брой пренесени кашони
  14.     boxes = int(command)
  15.     count_free_space -= boxes
  16.     if count_free_space <= 0:
  17.         print(f'No more free space! You need {abs(count_free_space)} Cubic meters more.')
  18.         break
  19.     command = input()
  20. else: print(f'{count_free_space} Cubic meters left.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement