5. Let $[t]$ denote the greatest integer not exceeding the real number $t$, and let $\{t\}=t-[t]$. Given that the real number $x$ satisfies $x^{3}+\frac{1}{x^{3}}=$
18. Then $\{x\}+\left\{\frac{1}{x}\right\}=(\quad)$.
(A) $\frac{1}{2}$
(B) $3-\sqrt{5}$
(C) $\frac{3-\sqrt{5}}{2}$
(D) 1
5. D.

Let $x+\frac{1}{x}=a$. Then
$$
\begin{array}{l}
x^{3}+\frac{1}{x^{3}}=\left(x+\frac{1}{x}\right)\left(x^{2}+\frac{1}{x^{2}}-1\right) \\
=\left(x+\frac{1}{x}\right)\left[\left(x+\frac{1}{x}\right)^{2}-3\right]=a\left(a^{2}-3\right) .
\end{array}
$$

Thus $a\left(a^{2}-3\right)=18$
$$
\begin{array}{l}
\Rightarrow(a-3)\left(a^{2}+3 a+6\right)=0 \\
\Rightarrow a=3 .
\end{array}
$$

From $x+\frac{1}{x}=3$, we get $x=\frac{3 \pm \sqrt{5}}{2}$.
Clearly, $0<\{x\}<1,0<\left\{\frac{1}{x}\right\}<1$.
Therefore, $\{x\}+\left\{\frac{1}{x}\right\}=1$.