Microsoft Profit Rises 31 Percent