5. The maximum number of consecutive integers whose sum is 45 is ( ).
(A) 9
(B) 25
(C) 45
(D) 90
(E) 120
5. D.

Let there be $n$ consecutive integers $a, a+1, \cdots, a+n-1$ that satisfy the condition, i.e.,
$$
\begin{array}{l}
a+a+1+\cdots+a+n-1 \\
=n a+\frac{n(n-1)}{2}=n\left(a+\frac{n-1}{2}\right)=45 \\
\Rightarrow n(2 a+n-1)=90 \Rightarrow n \mid 90 .
\end{array}
$$

When $n=90$, $a=-44$, at this time,
$$
-44-43+\cdots+43+44+45=45 \text {. }
$$

Therefore, $n_{\max }=90$.