Advertisement
veronikaaa86

06. Cake

Mar 27th, 2022
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. width = int(input())
  2. length = int(input())
  3.  
  4. total_pieces = width * length
  5.  
  6. input_line = input()
  7. while input_line != "STOP":
  8. current_pieces = int(input_line)
  9.  
  10. total_pieces = total_pieces - current_pieces
  11.  
  12. if total_pieces <= 0:
  13. break
  14. input_line = input()
  15.  
  16. if total_pieces > 0:
  17. print(f"{total_pieces} pieces are left.")
  18. else:
  19. print(f"No more cake left! You need {abs(total_pieces)} pieces more.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement