10. A set of important documents is locked in a safe, and now $n$ keys are given to $n$ students in sequence to open the cabinet, but only one of them can actually open the door. On average, the number of attempts needed to open the door is ( ).
(A) 1
(B) $n$
(C) $\frac{n+1}{2}$
(D) $\frac{n-1}{2}$
10.C.

Given that the probability of each student opening a locker is $\frac{1}{n}$, the average number of times a locker is opened (i.e., the mathematical expectation) is
$$
1 \times \frac{1}{n}+2 \times \frac{1}{n}+\cdots+n \times \frac{1}{n}=\frac{n+1}{2} .
$$