Answer:
With water it's easy. 1 cm3 of pure water equals 1 gram. With everything else, you need to know the density. Then use the formula density = mass / volume.
Re-write the formula as mass = density x volume.
The unit of density is g/cm3 - so you need not convert the units.