4. (20 points) (1) Find all real numbers $a$ such that the equation $x^{2}+(a+2002) x+a=0$ has two integer roots.
(2) Find all real numbers $a$ such that the equation $x^{3}+\left(-a^{2}+2 a+2\right) x-2 a^{2}-2 a=0$ has two integer roots.
(1) Let the two integer roots be $x_{1}$ and $x_{2}$, then
$$
\left\{\begin{array}{l}
x_{1}+x_{2}=-a-2002 . \\
x_{1} x_{2}=a .
\end{array}\right.
$$

From (D) 2 we get
$$
\begin{array}{l}
x_{1} x_{2}+x_{1}+x_{2}=-2002 . \\
\text { Hence }\left(x_{1}+1\right)\left(x_{2}+1\right)=-2001=-3 \times 23 \times 29 .
\end{array}
$$

Assume $x_{1} \leqslant x_{2}$, then $x_{1}+1 \leqslant x_{2}+1$. From (3) we know $x_{1}+10$. Therefore, we have
$$
\begin{array}{l}
\left\{\begin{array}{l}
x_{1}+1 \\
x_{2}+1
\end{array}=\left\{\begin{array} { l } 
{ - 1 , } \\
{ 2 0 0 1 ; }
\end{array} \left\{\begin{array} { l } 
{ - 2 0 0 1 , } \\
{ 1 ; }
\end{array} \left\{\begin{array} { l } 
{ - 3 , } \\
{ 6 6 7 ; }
\end{array} \left\{\begin{array}{l}
-667, \\
3 ;
\end{array}\right.\right.\right.\right.\right. \\
\left\{\begin{array} { l } 
{ - 2 3 , } \\
{ 8 7 ; }
\end{array} \left\{\begin{array} { l } 
{ - 8 7 , } \\
{ 2 3 ; }
\end{array} \left\{\begin{array} { l } 
{ - 2 9 , } \\
{ 6 9 ; }
\end{array} \left\{\begin{array}{l}
-69, \\
29 .
\end{array}\right.\right.\right.\right. \\
\end{array}
$$

Therefore, $-a-2000=x_{1}+x_{2}+2$
$$
=2000,-2000,664,-664,64,-64.40,-40 \text {, }
$$

which means $a=-4000,0,-2664,-1336,-2064$.
$$
-1936,-2040,-1960 \text {. }
$$
(2) Upon observation, we find that one root is $x=a$, hence it can be factored as
$$
(x-a)\left(x^{2}+a x+2 a+2\right)=0 \text {. }
$$

Thus, $a$ is an integer, and $x^{2}+a x+2 a+2=0$ has two integer roots.

Let the discriminant $\Delta=a^{2}-8 a-8=t^{2}$ (where $t$ is a non-negative integer), then $(a-4)^{2}=t^{2}+24$, so we have
$$
(a-4+t)(a-4-t)=2^{3} \times 3 \text {. }
$$

Since $a-4+t$ and $a-4-t$ have the same parity, $a-4+t$ and $a-4-t$ must both be even. And
$$
\begin{array}{l}
\frac{a-4+t}{2} \cdot \frac{a-\frac{4-t}{2}}{2}=2 \times 3, \frac{a-4+t}{2} \geqslant \frac{a-4-t}{2}, \\
\text { Hence }\left\{\begin{array}{l}
\frac{a-4+t}{2}, \\
\frac{a-4-t}{2}
\end{array}=\left\{\begin{array} { l } 
{ 6 , } \\
{ 1 ; }
\end{array} \quad \left\{\begin{array} { l } 
{ - 1 , } \\
{ - 6 ; }
\end{array} \left\{\left\{\begin{array} { l } 
{ 3 , } \\
{ 2 ; }
\end{array} \left\{\begin{array}{l}
-2, \\
-3 .
\end{array}\right.\right.\right.\right.\right.\right.
\end{array}
$$

Solving, we get $\left\{\begin{array}{l}a . \\ t\end{array}=\left\{\begin{array}{l}11, \\ 5 ;\end{array} \quad\left\{\begin{array}{c}-3, \\ 5 ;\end{array} \quad\left\{\begin{array}{l}9, \\ 1 ;\end{array}\left\{\begin{array}{l}-1, \\ 1 .\end{array}\right.\right.\right.\right.\right.$
Therefore, $a=-3,-1,9,11$.