06. Point on Rectangle Border
Здравейте,
Имам проблем със следния код -
import java.util.Scanner; public class PointInRectangle { public static void main(String[] args) { Scanner console = new Scanner(System.in); Double x1 = Double.parseDouble(console.nextLine()); Double y1 = Double.parseDouble(console.nextLine()); Double x2 = Double.parseDouble(console.nextLine()); Double y2 = Double.parseDouble(console.nextLine()); Double x = Double.parseDouble(console.nextLine()); Double y = Double.parseDouble(console.nextLine()); if ( ( x == x1 || x == x2 ) && ( y >= y1 && y <= y2 ) ) System.out.println("Border"); else if (( y == y1 || y == y2 ) && ( x >= x1 && x <= x2 ) ) System.out.println("Border"); else System.out.println("Inside / Outside"); } }
Получавам само 72 / 100
Някой има ли идеи?