координаты вершин намертво зашити в код
package com.gmail.vhrushyn;
import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Input x");
double x = sc.nextDouble();
System.out.println("Input y");
double y = sc.nextDouble();
if ( x < 0 || x > 6 || y < 0 || y > 4 || y < (x * (1.0 / 6.0))) {
System.out.println("you missed");
}
else {
if ((x <= 4 && y <= x) || (x >= 4 && y <= 3 -((x - 4) / 1.5 ))){
System.out.println("you hit");
}
else{
System.out.println("you missed");
}
}
sc.close();
}
}