标签:
int nCurSum=0;
int nGreatestSum=-2147483648;
for(int i=0;i<pDate.length;i++){
if(nCurSum<=0)
nCurSum=pDate[i];
else
nCurSum+=pDate[i];
if(nCurSum>nGreatSum)
nGreatestSum=nCurSum;
}
2 连续子数组的最大和
原文地址:http://www.cnblogs.com/JaneSJ/p/5910076.html