public class test1 { public static void main(String[] args) { int[] arr={99,25,34,48,63,78,101,71,12}; int max=arr[0]; for (int i=0;i<arr.length;i++){ if (arr[i]>max) { max = arr[i]; } } System.out.println("数组arr中的最大值为max= "+max); } }
public class test1 { public static void main(String[] args) { int[] arr={99,25,34,48,63,78,101,71,12}; int max=arr[0]; for (int i=0;i<arr.length;i++){ if (arr[i]>max) { max = arr[i]; } } System.out.println("数组arr中的最大值为max= "+max); } }