Ответ:

18 - 45 + 5x = 8
-27 + 5x = 8
5x = 35
x = 7