6. In the arithmetic sequence $\left\{a_{n}\right\}$, if $\frac{a_{11}}{a_{10}}<-1$, and the sum of the first $n$ terms $S_{n}$ has a maximum value, then when $S_{n}$ takes the smallest positive value, $n=$ $\qquad$ .
6. 19 .

Solution: Knowing that $S_{n}$ has a maximum value, the common difference of the arithmetic sequence $d<0$. Therefore, $a_{11}<0$. \\
Thus, $S_{10}>S_{9}>\cdots>S_{1}>0, \\
S_{10}>S_{11}>\cdots>S_{19}>0>S_{20}>S_{21}>\cdots .
\end{array}
$$

Next, compare $S_{1}$ with $S_{19}$.
$$
\text{By } S_{19}-S_{1}=a_{2}+a_{3}+\cdots+a_{19}=9\left(a_{10}+a_{11}\right)<
$$
0, we know that when $S_{n}$ takes its smallest positive value, $n=19$.