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