/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication33;

import eu.epfc.prm2.Array;



/**
 *
 * @author joelx
 */
public class JavaApplication33 {

    /**
     * @param args the command line arguments
     */
    public static void echange(Array<Integer> tab, int id1, int id2) {
        int tmp = tab.get(id1);
        tab.set(id1, tab.get(id2));
        tab.set(id2, tmp);
    }
    public static void renverse(Array<Integer> tab){
            int g = 0,
            d = tab.size() - 1; 
        while (g < d) {
            echange(tab, g, d);
            ++g;
            --d;
        }
    }
    public static void main(String[] args) {
        Array<Integer> tab = new Array<>(4, 7, 5, 2, 4, 3, 2, 3);
        System.out.println(tab);
        renverse(tab);
        System.out.println("voila le tableau renversé " +(tab));
        // TODO code application logic here
    }

    
}
