You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
350 B

#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[1000] = {0};
int maxCha = 0;
for (int i = 1; i < n; i++) {
cin >> a[i];
if (abs(a[i] - a[i - 1]) > maxCha) {
maxCha = abs(a[i] - a[i - 1]);
}
}
cout << maxCha << endl;
return 0;
}