Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
969 B
1
Indexable
Never

public class ArrayTridimensional {
   final static double [][][] DATOS = {
            {
                    {3.2, -6e2},
                    {1, -1.1e-1}
            },
            {
                    {1.2},
                    {5,5,67},
                    {0,12,1.1,6}


            },
            {
                    {5,5,5.5,6.23}
            }
    };
    public static void main(String[] args) {
        mostrarDatos(DATOS);
        double sumar = sumarDatos(DATOS);

    }

    private static double sumarDatos(double[][][] sumas) {
        
        return 0;
    }

    private static void mostrarDatos(double[][][] valores) {
        for (int i = 0; i < DATOS.length; i++) {
            for (int j = 0; j < DATOS[i].length; j++) {
                for (int k = 0; k < DATOS[i][j].length; k++) {
                    System.out.printf("datos[%d][%d][%d] = %.2f%n", i,j,k, DATOS[i][j][k] );

                }
                
            }
        }
    }
}