The continuous contact problem for two elastic layers resting on an elastic half-infinite plane and loaded by means of a rigid stamp is presented. The elastic layers have different heights and elastic constants. An external load is applied to the upper elastic layer by means of a rigid stamp. The problem is solved under the assumptions that all surfaces are frictionless, body forces of elastic layers are taken into account, and only compressive normal tractions can be transmitted through the interfaces. General expressions of stresses and displacements are obtained by using the fundamental equations of the theory of elasticity and the integral transform technique. Substituting the stress and the displacement expressions into the boundary conditions, the problem is reduced to a singular integral equation, in which the function of contact stresses under the rigid stamp is unknown. The integral equation is solved numerically by making use of the appropriate Gauss-Chebyshev integration formula for circular and rectangular stamp profiles. The contact stresses under the rigid stamp, contact areas, initial separation loads, and initial separation distances between the two elastic layers and the lower-layer elastic half-infinite plane are obtained numerically for various dimensionless quantities and shown in graphics and tables.