编写程序,提示用户输入一个点(x,y),然后检查这个点是否在以原点(0,0)为圆心,半径为10的圆内。
import java.util.Scanner;
class sy1a
{
public static void main(String[] args)
{
System.out.println("Enter a point with two coordinates:");
Scanner scan=new Scanner(System.in);
double x=scan.nextDouble();
double y=scan.nextDouble();
if(x*x+y*y<100)System.out.println("Point("+x+","+y+")is in the circle");
else System.out.println("Point("+x+","+y+")is not in the circle");
}
}