One-Dimensional Hydrodynamical Simulations of Gravitational Clustering in an Expanding Background