Let x = number of miles driven by the first car
y = number of miles driven by the second car
Then: x + y = 35
15x + 35y = 925
Multiply the first equation by -15:
-15x - 15y = -525
15x +35y = 925
Add the equations: 20y = 400
y = 20 and x = 15
ANSWER: the first car used 20 gallons and the second car used 15 gallons.