Advertisement
anton_d

06.cake

Feb 2nd, 2022 (edited)
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. width = int(input())
  2. length = int(input())
  3.  
  4. total_pieces = width * length / 1
  5. command = ''
  6.  
  7. while command != 'stop' and total_pieces > 0:
  8.     command = input().lower()
  9.     if command.isnumeric():
  10.         total_pieces -= int(command)
  11.     else:
  12.         break
  13.  
  14. if total_pieces > 0:
  15.     print('%d pieces are left.' % total_pieces)
  16. else:
  17.     print('No more cake left! You need %d pieces more.' % abs(total_pieces))
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement