提交时间:2024-04-20 10:15:57
运行 ID: 45764
#include <bits/stdc++.h> using namespace std; int main(){ int n, max = -1, min = 10000; cin >> n; int a[n]; for(int i = 0; i < n; i++){ cin >> a[i]; if(a[i] > max){ max = a[i]; } if(a[i] < min){ min = a[i]; } } cout << max - min; return 0; }