You have the next situation:
As the building and its shadow form a angle of 90º (right angle), you use the Pythagoras theorem:
The measure of x is equal to the square root of hypothenusa squared less the shadow measure squared:
Then, the building is 49.7 feet tall