x + y = 34.5
xy = 297
From the first one . . . y = 34.5 - x
Plug that into the second one . . . x(34.5 - x) = 297
Eliminate parentheses . . . 34.5x - x² = 297
Bend that around and tidy it up . . . x² - 34.5x + 297 = 0
Apply the quadratic formula to that, and find . . .
x =18
x = 16.5