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数组求最大值
最新推荐文章于 2024-08-01 15:05:06 发布