He did C cards and M motorcycles

C + M = 100

4C + 2M = 310

But M = 100-c, so

4c + 2(100-c) = 310

4c + 200 - 2c = 310

2c + 200 = 310

2c = 110

c = 55

M = 100-c = 100-55 = 45

55 cars and 45 motorcycles have

55*4+45*2 = 220 + 90 = 310 tires

55 cars and 45 motorcycles