提交时间:2024-10-27 10:24:09

运行 ID: 54323

#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int max = -10000000; int min = 10000000; for (int i = 0; i < n; i++) { int num; cin >> num; if(max < num){ max = num; } if(min>num){ min = num; } } cout<<max-min; }