摘要: 有个数组a[n]记录了一只股票每天的价格,在有最多两次机会 可以买1股卖1股,但是买入前必须保证手上没有股票,求收益最大值。比如a[6] = {3, 8, 5, 1, 7, 8},最大收益max = 12。```#include#include#includeint find_max(int* ar... 阅读全文
posted @ 2014-09-29 12:25 stardujie 阅读(136) 评论(0) 推荐(0) 编辑