#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int a,i=1,b[2001],d=0,x=1000;
cin>>a;
while(i<a+1){
cin>>b[i];
if(b[i]>d){
d=b[i];
}
else if(b[i]<x){
x=b[i];
}
i++;
}
cout<<d-x<<endl;
return 0;
}
代码AC了,但是当我输入
2
3 4
理应输出1,可是我的代码输出的是-996,竟然过了