5. The range of the function $y=[\sin x \cdot \cos x]+[\sin x+\cos x]$ is $(\quad)([x]$ denotes the greatest integer not exceeding the real number $x$”.
(A) $\{-2,-1,0,1,2\}$
(B) $\{-2,-1,0,1\}$
(C) $\{-1,0,1\}$
(D) $\{-2,-1,1\}$
5.D.
$$
y=\left[\frac{1}{2} \sin 2 x\right]+\left[\sqrt{2} \sin \left(x+\frac{\pi}{4}\right)\right]
$$

The following discussion assumes $k \in \mathbf{Z}$.
(1) When $2 k \pi \leqslant x \leqslant 2 k \pi+\frac{\pi}{2}$, $y=1$;
(2) When $2 k \pi+\frac{\pi}{2}<x \leqslant 2 k \pi+\frac{3 \pi}{4}$, $y=-1$;
(3) When $2 k \pi+\frac{3 \pi}{4}<x<2 k \pi+\pi$, $y=-2$;
(4) When $x=2 k \pi+\pi$ or $2 k \pi+\frac{3 \pi}{2}$, $y=-1$;
(5) When $2 k \pi+\pi<x<2 k \pi+\frac{3 \pi}{2}$, $y=-2$;
(6) When $2 k \pi+\frac{3 \pi}{2}<x<2 k \pi+\frac{7 \pi}{4}$, $y=-2$;
(7) When $2 k \pi+\frac{7 \pi}{4} \leqslant x<2 k \pi+2 \pi$, $y=-1$. In summary, $y \in\{-2,-1,1\}$.