#include <iostream>
#include <cmath>
using namespace std;
const int N = 1000;
int p[N + 10];
int main() {
int n;
cin >> n;
// for (int i = 0; i < n; i++) {
// cin >> p[i];
// }
// int max = 0;
// for (int i = 1; i < n; i++) {
// int dif = abs(p[i] - p[i - 1]);
// if (diff > max) {
// max = diff;
// }
// }
int p1, p2; // price
int t1, t2, diff, max = 0; // temp
cin >> p1;
t1 = p1;
while (--n) {
cin >> p2;
t2 = p2;
diff = abs(t1 - t2);
if (diff > max) {
max = diff;
}
t1 = p2;
}
cout << max << endl;
return 0;
}
201609-1 最大波动
最新推荐文章于 2021-03-15 00:53:40 发布