Suppose the set $X=10,-1,1 \mid, Y=\{-2,-1,0,1,2\}$, the mapping $f$ from $X$ to $Y$ satisfies the condition: for each $x \in X$, $x+f(x)$ is an odd number. The number of such mappings is
(A) 12
(B) 6
(C) 18
(D) 24
6. (C).

From the problem, we know that $f(0)$ is an odd number, which can be $f(0)=-1,1$, two possibilities; $f(-1)$ is an even number, which can take $f(-1)=-2$, 0, 2, three possibilities; $f(1)$ is an even number, which can take $f(1)=-2,0,2$, three possibilities. Therefore, such $f$ can have $2 \times 3 \times 3=$ 18 possibilities.