标签:print sum can 子列 c++ clu pre 问题 include
#include<stdio.h>
int main(){
int result = 0,thissum = 0, N, digit;
scanf("%d", &N);
for(int i = 0; i < N; i++){
scanf("%d", &digit);
thissum += digit;
if(thissum > result)
result = thissum;
if(thissum < 0) thissum = 0;
}
printf("%d", result);
return 0;
}
标签:print sum can 子列 c++ clu pre 问题 include
原文地址:https://www.cnblogs.com/zjsaipplp/p/10424838.html