Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- width = int(input())
- length = int(input())
- cake = width * length
- all = 0
- stopped = False
- while all < cake:
- pieces = input()
- if pieces == 'STOP':
- stopped = True
- break
- piece = int(pieces)
- all += piece
- if stopped:
- print(f"{cake-all} pieces are left.")
- if all>cake:
- print(f"No more cake left! You need {all-cake} pieces more.")
Add Comment
Please, Sign In to add comment