CCF|最大波动|Java|100

import java.util.*;

public class Main
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] ints=new int[n];
int m=-1;
for(int i=0;i {
ints[i]=in.nextInt();
}
for(int i=0;i {
m=Math.abs(ints[i]-ints[i+1])>m?Math.abs(ints[i]-ints[i+1]):m;
}
System.out.println(m);
}

}

你可能感兴趣的:(CCF|最大波动|Java|100)