暴力
连续子数组的最大和
http://www.nowcoder.com/questionTerminal/459bd355da1549fa8a49e350bf3df484
class Solution { public: int FindGreatestSumOfSubArray(vector<int> array) { if(array.size()<=0) return 0; vector<int> sums; int sum = 0; for(int i = 0; i<array.size(); i++) { for(int j = i; j <array.size(); j++) { sum +=array[j]; sums.push_back(sum); } sum = 0; } int max = INT_MIN; for(const int val : sums) { if(val>max) max = val; } return max; } };