摘要: public int maxSub(int a[]){int i,j;int max=0,temp=0;//保存最大值 int start=0,end=0;//起始位置for(i=0,j=0;j<a.length;j++){temp+=a[j];if(temp>max){max=temp;start=i;end=j;}else if(temp<0){i=j+1;//从j+1处重新... 阅读全文
posted @ 2010-11-02 10:30 hustyyg 阅读(332) 评论(0) 推荐(0) 编辑