.
Let x be the longest leg.
Then the shortest leg is (x-4) and the hypotenuse is (x+4).
Write the Pythagoras equation
(x-4)^2 + x^2 = (x+4)^2
(x^2 - 8x + 16) + x^2 = x^2 + 8x + 16
2x^2 = 16x
x*(x-8) = 0.
The roots are x= 0 and/or x= 8. Obviously, only positive root x= 8 is the solution to the problem.
ANSWER. The legs are 4 cm and 8 cm; the hypotenuse is 12 cm.
Alternatively, the problem can be solved mentally, by noticing that this right-angled triangle
is a standard (3,4,5) Pythagorean triangle.
Solved.
/////////////////
Do not use the dot symbol "." after abbreviation "cm".
According to the punctuation rules, the dot symbol is not used after this abbreviation.