#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int b;
cin >> b;
int result = b;
int ans = b;
for (int i = 1; i < n; i++) {
int t;
cin >> t;
result = max(result + t, t);
ans = max(result, ans);
}
cout << ans << endl;
return 0;
}
全部回复 共 0 条
还没有人回复。往下写第一条。
发表回复
登录后即可回复本帖,与出题人和同学一起讨论。
登录