数组查找最大和最小值 auto min_buy_price= min_element(prices.begin(),prices.begin()+i); profit = prices[i]-*min_buy_price