6. A bag contains 20 balls, of which 9 are white, 5 are red, and 6 are black. Now, 10 balls are randomly drawn from the bag, such that the number of white balls is no less than 3 and no more than 7, the number of red balls is no less than 2 and no more than 5, and the number of black balls is no more than 3. The number of ways to draw the balls is ( ).
(A) 14
(B) 24
(C) 13
(D) 36
6.A.

Notice that
$$
\begin{array}{l}
f(x)=\left(x^{3}+x^{4}+x^{5}+x^{6}+x^{7}\right) . \\
\quad\left(x^{2}+x^{3}+x^{4}+x^{5}\right)\left(1+x+x^{2}+x^{3}\right) \\
=\left(x^{3}+x^{4}+x^{5}+x^{6}+x^{7}\right)\left(x^{2}+2 x^{3}+3 x^{4}+\right. \\
\left.4 x^{5}+3 x^{6}+2 x^{7}+x^{8}\right)
\end{array}
$$

In this, the coefficient of $x^{10}$ is $2+3+4+3+2=14$. Therefore, there are 14 ways that satisfy the condition.