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