最大连续子数组和
子数组的最大累加和问题
http://www.nowcoder.com/questionTerminal/38014783330445b4936ccfad9990431c
include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
cin>>N;
vector<int> arr(N);
for(int i=0;i<N;i++)
cin>>arr[i];
int tmp = arr[0];
int m = arr[0];
for(int i=1;i<N;i++)
{
tmp = max(arr[i],tmp+arr[i]);
m = max(m,tmp);
}
cout<<m<<endl;
return 0;
}</int>