提交时间:2023-11-04 11:10:19
运行 ID: 108827
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; while(n!=0){ int min = 1e9+7,max = -1e9+7; for(int i = 0;i<n;i++){ int x; cin>>x; if(x>max) max = x; if(x<min) min = x; } cout<<max-min<<endl; cin>>n; } return 0; }