Tim Cook, the company’s C.E.O., said he expected $900 million in extra costs this quarter because of President Trump’s tariffs.