06. Point on Rectangle Border Java
Имам пролеми с 6-та задача Точка върху страната на правоъгълник от По-сложни логически провериполучавам 83/100 къде греша?
package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
double x1,x2,x,y,y1,y2;
Scanner scanner = new Scanner(System.in);
y1 = Double.parseDouble(scanner.nextLine());
x1 = Double.parseDouble(scanner.nextLine());
y2 = Double.parseDouble(scanner.nextLine());
x2 = Double.parseDouble(scanner.nextLine());
y = Double.parseDouble(scanner.nextLine());
x = Double.parseDouble(scanner.nextLine());
if((x==x1 || x==x2) && (y>=y1 && y<=y2))System.out.println("Border");
if((x>=x1 && x<=x2) && (y==y1 || y==y2))System.out.println("Border");
else System.out.println("Inside / Outside");
}
}
Благодаря :)
Моля :)