Advertisement
Spocoman

06. Cake

Dec 27th, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. piece_of_cake = int(input()) * int(input())
  2. hungry = 0
  3. while piece_of_cake >= hungry:
  4.     command = input()
  5.     if command == "STOP":
  6.         break
  7.     hungry += int(command)
  8.  
  9. if piece_of_cake >= hungry:
  10.     print(f'{piece_of_cake - hungry} pieces are left.')
  11. else:
  12.     print(f'No more cake left! You need {hungry - piece_of_cake} pieces more.')
  13.  
  14.  
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement