-
-
Save mariiaKolokolova/4594505bcdbd8cbb7bec2e47efbfa673 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
package maricka.kolokolova; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
Scanner sc = new Scanner(System.in); | |
int r = 4; | |
double x; | |
double y; | |
System.out.println("Input x:"); | |
x = sc.nextDouble(); | |
System.out.println("Input y:"); | |
y = sc.nextDouble(); | |
if (x * x + y * y <= r * r) { | |
System.out.println("You are right! Your point is inside the circle."); | |
} else { | |
System.out.println("Sorry! Your point is outside the circle."); | |
} | |
sc.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment