Advertisement
aneliabogeva

Cinema

Jun 15th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. capacity = int(input())
  2. commant = input()
  3. number_of_people = 0
  4. counter = 0
  5. income = 0
  6.  
  7. while commant != "Movie time!":
  8. number_of_people = int(commant)
  9. counter += number_of_people
  10. if counter <= capacity:
  11. if number_of_people % 3 == 0:
  12. income += number_of_people * 5 - 5
  13. else:
  14. income += number_of_people * 5
  15. else:
  16. print("The cinema is full.")
  17. print(f"Cinema income - {income} lv.")
  18. break
  19. commant = input()
  20.  
  21.  
  22. if commant == "Movie time!":
  23. print(f"There are {abs(capacity-counter)} seats left in the cinema.")
  24. print(f"Cinema income - {income} lv.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement