Skip to content

Instantly share code, notes, and snippets.

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