Skip to content

Instantly share code, notes, and snippets.

@sanrodari
Forked from godie007/ensayo.java
Created June 14, 2012 21:56
Show Gist options
  • Save sanrodari/2933224 to your computer and use it in GitHub Desktop.
Save sanrodari/2933224 to your computer and use it in GitHub Desktop.
import javax.swing.JOptionPane;
public class paradigma {
public static void main(String[] args) {
int[] in = ingresar();
sumar(in);
}
public static int[] ingresar() {
int arreglo[] = new int[10];
for (int i = 0; i < 10; i++) {
arreglo[i] = Integer.parseInt(JOptionPane.showInputDialog("ingredas"));
}
return arreglo;
}
public static void sumar(int[] in) {
int suma = 0;
for (int i = 0; i < in.length; i++) {
suma += in[i];
}
System.out.println(suma);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment