Explanation:
let's be more detailed than the other answer :
the perimeter is the sum of all sides of an object. in case of a triangle, well, that is the sum of all 3 sides.
so,
25 = x + (x-5) + (x+3) = x + x - 5 + x + 3 = 3x - 2
27 = 3x
x = 9
so, the sides are
x = 9 cm
(x-5) = 9 - 5 = 4 cm
(x+3) = 9 + 3 = 12 cm