5. Given a sequence of numbers $a_{1}, a_{2}, \cdots, a_{100}$, where $a_{3} = 9, a_{7} = -7, a_{98} = -1$, and the sum of any three consecutive numbers is a constant. Then the value of $a_{1} + a_{2} + \cdots + a_{100}$ is ( ).
(A) 0
(B) 40
(C) 32
(D) 26
5.D.

According to the problem, we have
$$
\begin{array}{l}
a_{1}=a_{4}=a_{7}=\cdots=a_{100}=-7, \\
a_{2}=a_{5}=a_{8}=\cdots=a_{98}=-1, \\
a_{3}=a_{6}=a_{9}=\cdots=a_{99}=9 .
\end{array}
$$

Then $\bar{a}_{1}+a_{2}+\cdots+a_{100}$
$$
=33(9-7-1)-7=26 \text {. }
$$