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