标签:
1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter a point with two coordinates: "); 10 double x = input.nextDouble(); 11 double y = input.nextDouble(); 12 13 input.close(); 14 15 if(Math.abs(x) <= 5 && Math.abs(y) <= 2.5) 16 System.out.println("Point (" + x + ", " + y + ") is in the rectangle"); 17 else 18 System.out.println("Point (" + x + ", " + y + ") is not in the rectangle"); 19 } 20 }
标签:
原文地址:http://www.cnblogs.com/wood-python/p/5766165.html