Yes. As a cube is a 3-dimensional body, all the particles of a system lying in a cube lie in the x,y and z plane.
Let the ith element of mass ∆mi is located at the point (xi,yi,zi).
The co-ordinates of the centre of mass are given as:
X, Y and Z lie inside the cube because it is a weighted mean.