Let us choose the nucleus of the hydrogen atom as the origin for measuring distance.

Mass of hydrogen atom, m1 = 1 unit (let)
Mass of chlorine atom, m2 = 35.5 units (let)
Now, x1 = 0 and x2 = 1.27 Å
= 1.27 x 10-10 m
Distance of CM of HCl molecule from the origin is given by
x = {m1x1 + m2x2}/{m1 + m2}
= {1 x 0 + 35.5 x 1.27 x 10-10}/{1 + 35.5}
= 1.235 x 10-10 m
= 1.235 Å