提交时间:2023-12-16 10:43:16
运行 ID: 116327
#include<iostream> using namespace std; int a,b,c[1005],d,e=0,f,g; int main() { cin>>a; for(b=1;b<=a;b++) cin>>c[b]; for(b=1;b<=a;b++) for(d=b+1;d<=a;d++) if(c[d]>c[b]) e=e>=c[d]-c[b]?e:c[d]-c[b]; cout<<e; return 0; }