Answer:
18 cm
Step-by-step explanation:
Let X represent a square
For it to be a rectangle, needs to be:
X X X
X X X
X X X
(It's a giant square made of squares)
This works since a square is a rectangle, but a rectangle isn't always a square. No other arrangement of the squares lead to a rectangle.
For Example:
X X X X
X X X X X
It doesn't work because there is an odd number of squares, and only would work if it was a multiple of 3,5,7 etc.. and 3 is the only number that fits.
So if the length is 18cm, the width is also 18cm.