提交时间:2024-11-08 15:52:28
运行 ID: 55830
#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; }