Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created October 26, 2022 15:33
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/17ca8ab6457249c48b29e68cc984b21b to your computer and use it in GitHub Desktop.
Save parzibyte/17ca8ab6457249c48b29e68cc984b21b to your computer and use it in GitHub Desktop.
int mayor = numeros.get(0);
int menor = numeros.get(0);
for (int numero : numeros) {
if (numero > mayor) {
mayor = numero;
}
if (numero < menor) {
menor = numero;
}
}
System.out.printf("Máximo: %d; Mínimo: %d", mayor, menor);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment