Piont in a circle

来源:互联网 发布:乱世佳人影评知乎 编辑:程序博客网 时间:2024/05/22 03:48
问题及代码:import java.util.Scanner;public class first {/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stubScanner point = new Scanner(System.in);System.out.println("Enter a point with two coordinates: ");int r=10;double p1 = point.nextInt();double p2 = point.nextInt();if(Math.sqrt(p1*p1+p2*p2)<10){System.out.printf("Point ("+ p1 + "," + p2 + ") is in the circle");}else{System.out.printf("Point ("+ p1 + "," + p2 + ") is not in the circle");}}}


 

 

运行结果:

0 0
原创粉丝点击