int nCurSum=0; int nGreatestSum=-2147483648; for(int i=0;inGreatestSum) nGreatestSum=nCurSum; } 转载于:https://www.cnblogs.com/JaneSJ/p/5915038.html