若 $A=\left[\begin{array}{ccc}2 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & x\end{array}\right]$ 与 $B=\left[\begin{array}{ccc}2 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & -1\end{array}\right]$ 相似,则 $x=(\quad)$ .
$\text{A.}$ -1
$\text{B.}$ 0
$\text{C.}$ 1
$\text{D.}$ 2
$\text{E.}$
$\text{F.}$