算法 1.4.17

来源:互联网 发布:乐高 t r3x 编程下载 编辑:程序博客网 时间:2024/06/06 03:22
public static double Pro1_4_17(double[] a){double[] temp = a.clone();for(int i=0;i<temp.length;i++)if(temp[i]<0) temp[i]=-temp[i];Arrays.sort(temp);return temp[temp.length-1] - temp[0];}