package matriz; import javax.swing.JOptionPane; /** * * @author adiela */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { String num,b; int x=0,i=0; int suma=0; int matriz[][]=new int [3][4]; String vec[]=new String[10]; float prom; for (int f=0;f<3;f++) { for (int c=0;c<4;c++) { num=JOptionPane.showInputDialog("ingrese numero"); matriz [f][c]=Integer.parseInt(num); } } for (int f=0;f<3;f++) { for (int c=0;c<4;c++){ suma=suma+matriz[f][c]; } } prom=suma/12; JOptionPane.showMessageDialog(null, "El promedio es"+prom); } }