(8) Let $S(n)$ denote the sum of the digits of the positive integer $n$, then $\sum_{n=1}^{2011} S(n)=$
828072 Prompt: Adding the natural number 0 does not change the nature of the problem; first consider the thousand numbers from 0 to 999, representing all of them as three-digit numbers, resulting in the set \( M = \{000, 001, \cdots, 999\} \). It is easy to see that for each \( a \in \{0, 1, \cdots, 9\} \), there are exactly 100 "three-digit numbers" starting with \( a \): \( \overline{a 00}, \overline{a 01}, \cdots, \overline{a 99} \).
Thus, the sum of the first digits of all three-digit numbers is
\[
100(0+1+\cdots+9) = 45 \cdot 100.
\]

Next, by swapping the first two digits of each number \( \overline{a b c} \) in \( M \), we get \( \overline{b a c} \), resulting in a set of a thousand numbers which is still \( M \),

and by swapping the first and last digits of each number \( \overline{a b c} \) in \( M \), we get \( \overline{c b a} \), resulting in a set of a thousand numbers which is also \( M \). Therefore,
\[
\sum_{n=1}^{999} S(n) = \sum_{n=0}^{999} S(n) = 300 \cdot 45.
\]

Now consider four-digit numbers: in \( 1000, 1001, \cdots, 1999 \), the first digit (thousands place) has a total of one thousand 1s, while in \( 0000, 0001, \cdots, 0999 \), the first digit (thousands place) has a total of one thousand 0s, thus
\[
\begin{aligned}
\sum_{n=1}^{1999} S(n) & = \sum_{n=0}^{1999} S(n) = 1000 + 2 \sum_{n=0}^{999} S(n) \\
& = 1000 + 600 \cdot 45 = 28000.
\end{aligned}
\]

Furthermore, it is easy to calculate \( \sum_{n=2000}^{2011} S(n) = 72 \). Therefore,
\[
\sum_{n=1}^{2011} S(n) = \sum_{n=0}^{2011} S(n) = 28072.
\]