

Let ABC is the right angle triangle, right angle at B
So, ∠B = 90 degree
Let the length of the hypotenuse AC = x
Now, base BC = x - 1
and altitude AB = x - 18
Now, according to Pythagoras Theorem,
AC2 = AB2 + BC2
=> x2 = (x - 18)2 + (x - 1)2
=> x2 = x2 + (18)2 - 2*x*18 + x2 + 12 - 2*x*1
=> x2 = x2 + 324 - 36x + x2 + 1 - 2x
=> x2 - x2 = 324 - 36x + x2 + 1 - 2x
=> 0 = 324 - 36x + x2 + 1 - 2x
=> x2 - 38x + 325 = 0
=> x2 - 25x - 13x + 325 = 0
=> x(x - 25) - 13(x - 25) = 0
=> (x - 25)*(x - 13) = 0
=> x = 13, 25
Since x = 13 is not possible.
So, x = 25
Now, AC = 25 cm
BC = 25 - 1 = 24 cm
and AC = 25 - 18 = 7 cm
So, the length of sides of triangle are: 25 cm, 24 cm, 7 cm
