Run ID:147598

提交时间:2026-02-06 13:52:09

#include<bits/stdc++.h> using namespace std; int main(){ int a[10001],b,d,x; cin>>b; cin>>a[1]; x = d = a[1]; for(int i = 2;i<=b;i++){ cin>>a[i]; if(a[i] > x)x=a[i]; if(a[i] < d)d = a[i]; } cout<<(x-d); }