-
-
Save parzibyte/cc91d0b79e3da53a355bd052fbcffa26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Escribe un número entero: "); | |
int algunEntero = sc.nextInt(); | |
System.out.println("El número es: " + algunEntero); | |
// Consumir salto de línea que dejó nextInt | |
sc.nextLine(); | |
System.out.println("Ahora escribe una cadena: "); | |
String cadena = sc.nextLine(); | |
System.out.println("La cadena es: " + cadena); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment