提交时间:2023-11-22 20:54:34

运行 ID: 31740

#include <bits/stdc++.h> using namespace std; int main() { int n, a, minn = 1e6, maxn = -1e6; while (n--) { cin >> a; if (a <= minn) minn = a; if (a >= maxn) maxn = a; } cout << maxn - minn; return 0; }