I guess that the circles are touching externally, although the condition/your post does not state it. Then one side of the triangle has the length of 5+7 = 12 cm; the other side has the length of 5+8 = 13 cm and the third side has the length of 7+8 = 15 cm. Then the perimeter of the triangle is 12 + 13 + 15 = 40 cm. Answer. The perimeter of the triangle ABC is 40 cm.