Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
570 B
3
Indexable
Never
import java.util.InputMismatchException;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner entrada = new Scanner(System.in);
        int[] lista = {3, 2, -4, 8, 4, 0, 6};

        System.out.print("Ingrese un valor de la lista:\n [3, 2, -4, 8, 4, 0, 6]\n > "
                );
        try{
            int valor = entrada.nextInt();
            double divicion = lista[valor] / lista[valor+1]
        }
        catch (InputMismatchException e)) {

        }
        //completar...


    }
}