标签:amp else pre turn [] lse define std maxsize
#include <stdio.h> #define MAXSIZE 10000 int MaxSubseqSum4(int List[], int N); int main() { int List[MAXSIZE]; int N; scanf("%d", &N); int i; for(i=0; i<N; ++i) scanf("%d", &List[i]); int ans=MaxSubseqSum4(List, N); printf("%d\n", ans); return 0; } int MaxSubseqSum4(int List[], int N) { int ThisSum=0, MaxSum=0; int i; for(i=0; i<N; ++i) { ThisSum+=List[i]; if(ThisSum>MaxSum) MaxSum=ThisSum; else if(ThisSum<0) ThisSum=0; } return MaxSum;
标签:amp else pre turn [] lse define std maxsize
原文地址:https://www.cnblogs.com/ozxics/p/10705307.html