提交时间:2024-01-28 17:18:58
运行 ID: 38847
#include<iostream> using namespace std; int main() { int n,minn,maxn,num; cin>>n; maxn=0; minn=1001; while(n--){ cin>>num; if(num<minn){ minn=num; } if(num>maxn){ maxn=num; } } cout<<maxn-minn; return 0; }