提交时间:2023-11-27 21:35:23
运行 ID: 32303
#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; }