If the dimensions are measured in cm and the masses in grams, the density will be obtained in the commonly used unit of g/cm (sometimes written g/cc).
(the dimensions; are measured; in cm) (the density; will be obtained; in the commonly used unit of g/cm)
the dimensions the density
are measured will be obtained
in cm
in the commonly used unit of g/cm