The results reflect a year of heavy investment for the company as it expanded customer benefits like one-day delivery and sought out larger clients for its profitable cloud computing business.