方法1 直接解题
int maxProfit(int* prices, int pricesSize) {
int temp1 = 0;
int temp2 = 0;
for (int i = 0; i < pricesSize - 1; i++) {
for (int j = i+1; j < pricesSize; j++) {
if (prices[j] <= prices[i]){
continue;
}
temp2 = prices[j] - prices[i];
if (temp1 < temp2){
temp1 = temp2;
}
}
}
return temp1;
}