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