0
已解决
刘乐宸
新手天翼
新手天翼
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
//#include <windows.h>
using namespace std;
int a[10001],f[10001],mx,mi;
int main(){
// freopen("AC.in","r",stdin);
// freopen("AC.out","w",stdout);
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
f[i]=a[i]+a[i-1];
mx=max(f[i],mx);
mi=min(f[i],mi);
}
cout<<mx-mi;
// fclose(stdin);
// fclose(stdout);
return 0;
}
哪错了