When I was in school, the teachers used to say no snacks in class unless you brought enough for everyone. Until I did. Then it became no snacks period.

Then we just got better about hiding it.