8. The cunning rabbit and the foolish fox agreed: if the fox crosses the bridge in front of the rabbit's house each time, the rabbit will give the fox money to double the fox's money, but each time crossing the bridge, the fox has to pay the rabbit 40 cents as a toll. Hearing that his money would double every time he crossed the bridge, the fox was very happy, but after crossing the bridge three times, it found that all its money had been given to the rabbit. Then the fox initially had ( ) cents.
(A) 20
(B) 30
(C) 35
(D) 40
(E) 45
8. C.

Let $f(x)=2 x-40$. Then
$$
\begin{array}{l}
f(f(f(x)))=0 \\
\Rightarrow 2[2(2 x-40)-40]-40=0 \\
\Rightarrow x=35 .
\end{array}
$$