package org.dkaverznev.lesson2; import java.util.Scanner; public class Main { public…
- Assistant
Hello! How can I assist you today?
- User
package org.dkaverznev.lesson2;
import java.util.Scanner;
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in);
codedouble x = sc.nextDouble(); double y = sc.nextDouble(); boolean out1 = (y <= x); boolean out2 = (x <= 2); boolean out3 = (y >= 0); boolean out4 = ! (x * x + y * y < 4); String out = (out1 && out2 && out3 && out4) ? "YES" : "NO"; System.out.println(out); }}
Что не так
Exception in thread "main" java.util.InputMismatchException
- Assistant
The
InputMismatchExceptionoccurs when theScannerobject expects a certain type of input but receives something different. In your code, you're using to read two double-precision floating-point numbers from the user. This exception typically arises if: