Lời giải:
Kẻ đường cao $AH$ ($H\in BC$)
Theo định lý Pitago:
$AB^2-BH^2=AH^2=AC^2-CH^2$
$\Leftrightarrow AB^2-BH^2=AC^2-(BC-BH)^2$
$\Leftrightarrow AB^2-BH^2=(12-AB)^2-(8-BH)^2$
$\Leftrightarrow 80-24AB+16BH=0$
$\Leftrightarrow 10-3AB+2BH=0(1)$
Mặt khác: $\frac{BH}{AB}=\cos B=\cos 60=\frac{1}{2}\Rightarrow AB=2BH(2)$
Từ $(1);(2)\Rightarrow AB=5$ (cm)
$AC=12-5=7$ (cm)