Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created October 26, 2022 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/9b9405729ed1c93db03216dd73196b6a to your computer and use it in GitHub Desktop.
Save parzibyte/9b9405729ed1c93db03216dd73196b6a to your computer and use it in GitHub Desktop.
Scanner sc = new Scanner(System.in);
ArrayList<Integer> numeros = new ArrayList<>();
while (true) {
System.out.println("Ingresa un número: ");
int numero = sc.nextInt();
if (numero == 0) {
break;
} else {
numeros.add(numero);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment