Example 6 (2002 National High School Competition Question) Given two sets of real numbers $A=\left\{a_{1}, a_{2}, \cdots, a_{100}\right\}$ and $B=$ $\left\{b_{1}, b_{2}, \cdots, b_{50}\right\}$, if the mapping $f$ from $A$ to $B$ makes each element in $B$ have a preimage and $f\left(a_{1}\right) \leqslant f\left(a_{2}\right) \leqslant \cdots \leqslant$ $f\left(a_{100}\right)$, then the number of such mappings is ( ).
A. $C_{100}^{50}$
B. $C_{98}^{49}$
C. $C_{100}^{99}$
D. $C_{99}^{49}$
Solution: Choose D. Reason: Without loss of generality, let $b_{1} \leqslant b_{2} \leqslant \cdots \leqslant b_{50}$, and divide $a_{1}, a_{2}, \cdots, a_{50}$ into 50 non-zero groups $c_{1}, c_{2}, \cdots, c_{50}$. Suppose there are $x_{i}$ numbers in $c_{i}$ ( $\left.x_{i} \geqslant 1, i=1,2, \cdots, 50\right)$, then we let the numbers in $c_{i}$ correspond to $b_{i}$ $(i=1,2, \cdots, 50)$, so the mappings that meet the conditions can only be such mappings, and the number of such mappings is equal to the number of positive integer solutions of the indeterminate equation $x_{1}+$ $x_{2}+\cdots+x_{50}=100$, which is $C_{99}^{9}$.