CSP-201712-1-最小差值
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<int>arr;
int main() {int n, minDelta = 99999;cin >> n;for (int i = 0; i < n; i++){int t;cin >> t;arr.push_back(t);}for (int i = 0; i < n; i++){for (int j = i + 1; j < n; j++){int delta = abs(arr[i] - arr[j]);minDelta = min(minDelta, delta);}}cout << minDelta;return 0;
}