现在已知数组int[] arr = {12,34,465,3,45}; 要求创建一个新的数组,将arr的元素倒序放入新数组中, 然后求出数组中的最大值是多少? 然后求出最大值的角标是第几个/* * 现在已知数组int[] arr = {12,34,465,3,45}; * 要求创建一个新的数组,将arr的元素倒序放入新数组中, * 然后求出数组中的最大值是多少?然后求出最大值的角标是第几个 */ public class Test { public static void main(String[] args) { int[] arr = {12,34,456,3,45}; System.out.print("arr[]:"); for(int i = 0; i
运行结果
arr[]:12 34 456 3 45 newArr[]:45 3 456 34 12 最大值:456 最大值角标为:2 最大值角标为:2