package com.lovcoding.day06;

import java.util.Arrays;

public class TestArr03_Revers_2 {
    //方式1
    public static void main(String[] args) {

        int[] arr = {1,3,5,6,8,9,11,14,16,18,19,22,25,27,28,29,35,46,57,67,78,98};

        //反转
        for (int left = 0 ,right = arr.length -1; left<right; left++ , right--) {
            //交换
            int temp = arr[left];
            arr[left] = arr[right];
            arr[right] = temp;
        }

        System.out.println(Arrays.toString(arr));
    }
}
