4. Given that $f$ is a mapping from the set $M=\{a, b, c\}$ to the set $N=\{-3,-2, \cdots, 3\}$. Then the number of mappings $f$ that satisfy
$$
f(a)+f(b)+f(c)=0
$$

is ( ).
(A) 19
(B) 30
(C) 31
(D) 37
4. D.

Notice that $f(a)+f(b)+f(c)$ has the following form:
$$
\begin{array}{l}
0+0+0,(-1)+0+1,(-2)+0+2 \\
(-3)+0+3,(-2)+(-1)+3 \\
2+1+(-3), 1+1+(-2) \\
(-1)+(-1)+2
\end{array}
$$

In total, there are $1+5 \mathrm{~A}_{3}^{3}+2 \times 3=37$.
