Sorry, but I do not know Portuguese, so this answer is in English.
Let the initial distance between the observer and the building be $x$m.
Then, from the figure, $$\begin{align} \tan 60^0 &= \dfrac{h}{x} \\\ \tan 45^0 &= \dfrac{h}{x+30} \end{align}$$
So, we get, $$h = \sqrt{3}x$$ $$h = x + 30$$
Now, eliminate $x$ and you will get,
$$h = \dfrac{30\sqrt{3}}{\sqrt{3}-1}$$