基础题。
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
int N;
while (scanf("%d", &N) != EOF)
{
int a, b, c;
scanf("%d%d", &a, &b);
int maxR = abs(a - b);
int index = 2;
for (int i = 3; i <= N; i++)
{
scanf("%d", &c);
int tempR = abs(b - c);
if (tempR > maxR)
{
maxR = tempR;
index = i;
}
b = c;
}
printf("%d %d\n", index - 1, index);
}
return 0;
}
继续加油。