Advertisement
MladenKarachanov

pointOnRentagleBorder

May 11th, 2024
906
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. package ProgrammingBasics2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class pointOnRentagleBorder {
  6.     public static void main(String[] args) {
  7.  
  8.         Scanner scan = new Scanner(System.in);
  9.         double x1 = Double.parseDouble(scan.nextLine());
  10.         double y1 = Double.parseDouble(scan.nextLine());
  11.         double x2 = Double.parseDouble(scan.nextLine());
  12.         double y2 = Double.parseDouble(scan.nextLine());
  13.         double x = Double.parseDouble(scan.nextLine());
  14.         double y = Double.parseDouble(scan.nextLine());
  15.  
  16.         if ((x == x1 || x == x2) && (y1 < y && y < y2)) {
  17.  
  18.             System.out.println("Border");
  19.  
  20.         } else if ((y == y1 || y == y2) && (x1 < x && x < x2)){
  21.            
  22.             System.out.println("Border");
  23.            
  24.         }else{
  25.            
  26.             System.out.println("Inside / Outside");
  27.  
  28.         }
  29.     }
  30. }
  31.  
  32.  
  33.  
  34. // НЕ Е РЕШЕНА
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement