.
Let x = fuel amount (in gallons) consumed by the first car at 35 mi/gallon, and
let y = fuel amount (in gallons) consumed by the second car at 15 mi/gallon.
From the condition, you have these two equation
x + y = 35 gallons (1)
35x + 15y = 825 miles (2)
Simplify by dividing equation (2) by 5 (both sides). You will get
x + y = 35 (3)
7x + 3y = 165 (4)
From equation (3), express y = 35-x and substitute it into equation (4). You will get
7x + 3*(35-x) = 165
7x + 105 - 3x = 165
7x - 3x = 165 - 105
4x = 60
x = 60/4 = 15.
ANSWER. First car consumed 15 gallons of gas; second car consumed the rest 35-15 = 20 gallons of gas.
Solved.