public class J3_23 {
public static void main(String[] args) {
// TODO Auto-generated method stub
java.util.Scanner input = new java.util.Scanner(System.in);
System.out.print("Enter a ponit with two coordinates");
double x = input.nextDouble();
double y = input.nextDouble();
if(x <= 5 && y <=2.5)
System.out.println("Point ("+x+","+y+") is in the rectangle");
else
System.out.println("Point ("+x+","+y+") isn't in the rectangle");
}
}
Java语言程序设计(基础篇)第十版 综合题 **3.23(几何: 点是否在矩形内?)
最新推荐文章于 2022-01-20 07:52:11 发布