- public static void reverseArray11(int[] arr1,int[] arr2){
- int max = (arr1.length>arr2.length)?(arr1.length):(arr2.length);
- int min = (arr1.length<arr2.length)?(arr1.length):(arr2.length);
- int[] temp = new int [max];
- for (int i = 0;i <= min -1 ;i++ ) {
- temp[i] = arr1[i];
- arr1[i] = arr2[i];
- arr2[i] = temp[i];
- }
-
-
- }/*
复制代码 |
|