In a class at school, all students are the same age, except for seven of them who are 1 year younger and two of them who are 2 years older. The sum of the ages of all the students in this class is 330. How many students are there in this class?
Let's denote by $a$ the common age of the students and by $n$ the number of students in this class. We have seven students who are $a-1$ years old, two who are $a+2$ years old, and the rest, that is, $n-9$ students, are $a$ years old. Therefore, the sum of the ages of all the students, which is 330, can be broken down into $330=7(a-1)+2(a+2)+(n-9) a=n a-3$, so that $n a=330+3=333=9 \times 37$.

Since the class has more than 9 students, then $a=9$ and $n=37$, that is, the class has 37 students.