package ExercicioQuinze;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int numero;
Scanner leitorScanner = new Scanner (System.in);
numero = leitorScanner.nextInt();
if (numero >= 100 && numero <= 200){
System.out.println("O numero está no intervalo");
}else {
System.out.println("O numero não está no intervalo");
}
}
}
erro na execução
Task :run
Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:862)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at ExercicioQuinze.Main.main(Main.java:14)
Task :run FAILED
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:run’.
Process ‘command ‘C:\Program Files\Java\jdk1.8.0_202\bin\java.exe’’ finished with non-zero exit value 1
-
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. -
Get more help at https://help.gradle.org
BUILD FAILED in 1m 8s
2 actionable tasks: 1 executed, 1 up-to-date