We consider an atomless exchange economy with indivisible commodities. Every commodity can be consumed only in integer amounts. In such an economy, because of the indivisibility, the preference maximization does not imply the cost minimization. We prove that the strong core coincides with the set of cost-minimized Walras allocations which satisfy both the preference maximization and the cost minimization under the same price vector.