Answer: Then let the cat live in X and the dog live in Y.
①y=3X- 12
②X=2y-2 1
Bring ① into ② to get X=2(3X- 12)-2 1, that is, X=6X-45 to get X=9.
y = 3X- 12 = 27- 12 = 15
To sum up, cats 15 years old and dogs are 9 years old.