18. The zeros of the function $f(x)=x^{2}-a x+2 a$ are integers. Then the sum of all possible values of $a$ is ( ).
(A) 7
(B) 8
(C) 16
(D) 17
(E) 18
18. C.

Let the function $f(x)=x^{2}-a x+2 a$ have zeros $m$ and $n (m, n \in \mathbf{Z})$.
By Vieta's formulas, we know $m+n=a, m n=2 a$.
Thus, $m n-2 m-2 n+4=4$
$\Rightarrow(m-2)(n-2)=4$
$\Rightarrow(m, n)=(3,6),(6,3),(4,4)$,
$(1,-2),(-2,1),(0,0)$
$\Rightarrow a=m+n=-1,0,8,9$.
Therefore, the required sum is $-1+0+8+9=16$.