c = # of cars
b = # of buses
c + b = 102
3c + 10b = 418
multiply the first equation by -3
-3c - 3b = -306
3c + 10b = 418
combine equations and you get
7b = 112
b = 16
substitute back into c + b = 102 and you get
c + 16 = 102
c = 86
16 buses and 86 cars