标签:style color os io ar 数据 div sp on
1 5 1 2 -1 3 -2
5
#include<stdio.h> int main() { int N; scanf("%d",&N); while(N--) { int max,n,i,sum; scanf("%d",&n); scanf("%d",&sum); max=sum; n=n-1; while(n--) { scanf("%d",&i); if(sum>=0) sum+=i; else sum=i; if(sum>max) max=sum; } printf("%d\n",sum); } return 0; }
标签:style color os io ar 数据 div sp on
原文地址:http://blog.csdn.net/u013238646/article/details/39138591