求大虾帮忙
求数组中的最大数public class zhaozuidashu {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double[] dscalr={34.5,76.7,68.6,15.6,89.5,34.8,88.7,65,81.8};
System.out.print("输出的原始数据:");
for(double row:dscalr)
System.out.print(row+"\t");
int i, j = 0;
double tem=0.0;
for (i = 0; i < dscalr.length; i++) {
if (dscalr[j] < dscalr[i + 1]) {
tem = dscalr[i + 1];
j = i + 1;
}
}
System.out.println("max=" + tem);
}
}
新手,实在不知道该怎么下手