Ling36
import java.util.Arrays;
public class HelloWorld {
public static void reSort(int[] arr){
int n = arr.length;
for(int i = 0; i < n/2 - 1; i++){
swap(arr,i,n-1-i);
}
}
public static void swap(int[] arr, int a, int b){
int temp = arr[a];
arr[a] = arr[b];
arr[b] = temp;
}
public static void main(String[] arg) {
int[] arr = {1,2,3,4,5,6,7};
reSort(arr);
System.out.println(Arrays.toString(arr));
}
}