提交时间:2023-12-03 16:46:33
运行 ID: 32942
#include<iostream> using namespace std; int main(){ int n,x,maxn=-1,minn=100000; cin>>n; for(int i=1;i<=n;i++){ cin>>x; if(x>maxn) maxn=x; if(x<minn) minn=x; } cout<<maxn-minn; return 0; }