You can make a right triangle with the leg in between the building and the surveyor being 2,227 ft and the height of the building being the other leg (x). To find x you can use the fact that tan(31)=x/2,227 which means x=tan(31)2,227. Therefore x=1338.12 feet which means the building is 1338.12 feet tall.
I hope this helps. let me know in the comments if anything is unclear.