public class ChangeArgs01 {
public static void main(String[] args) {
Count04 c = new Count04();
int maxNum = c.max(5,3,9,7);
System.out.println("最大值:"+maxNum);
}
}
class Count04{
public int max (int num,int...other){
int max = num;
for (int i =0; i<other.length;i++){
if (other[i]>max){
max = other[i];
}
}
return max;
}
}
java数组求最大值
Java最大值求解
最新推荐文章于 2024-03-17 20:23:03 发布
7853

被折叠的 条评论
为什么被折叠?



