To find the number of offices on each floor of the building, you need an equation that represents the total number of offices (396) in relation to the number of floors (18) and the number of offices per floor (f).
The correct equation to use in this case would be:
\[ 18f = 396 \]
This means that the total number of offices (396) is equal to the number of floors (18) multiplied by the number of offices per floor (f).
So, the correct answer is B: 18f = 396.