标签:max value pre turn oid out 参数 main void inf
public static void main(String[] args) {
printmax(34,3,2,5,67);
printmax(new double[]{1,2,3});
}
public static void printmax(double...number){
if (number.length==0){
System.out.println("No argument passed");
return;
}
double result=number[0];
for (int i = 0; i <number.length ; i++) {
if (number[i]>result){
result=number[i];
}
}
System.out.println("the max value is "+result);
}
}
标签:max value pre turn oid out 参数 main void inf
原文地址:https://www.cnblogs.com/acg-lbj/p/13032886.html