Answer
27 cm and 36 cm
Work Step by Step
hypotenuse = 45 cm
one leg is 9 cm longer than the other
$(x+9)^2+x^2=45^2$
$x^2+18x+81+x^2=2025$
$2x^2+18x=1944$
$(2x^2+18x=1944)/2$
$x^2+9x=972$
$x^2+9x-972=0$
$x^2+36x-27x-972=0$
$x(x+36)-27(x+36)=0$
$(x-27)(x+36)=0$
$x-27=0$
$x=27$
$x+36=0$
$x=-36$ (invalid since we can't have a negative length)
$27+9=36$