Skip to content

Instantly share code, notes, and snippets.

@Sergaav
Created March 26, 2015 13:44
Show Gist options
  • Save Sergaav/bb920e3ca6cb4da4cc95 to your computer and use it in GitHub Desktop.
Save Sergaav/bb920e3ca6cb4da4cc95 to your computer and use it in GitHub Desktop.
Triangle and point (x,y)
package com.gmail.sergaav.dz3_3;
import java.util.Scanner;
public class dz3_3 {
public static void main(String[] args) {
double x;
double y;
Scanner sc = new Scanner(System.in);
System.out.println("Input x:");
x = sc.nextDouble();
System.out.println("Input y:");
y = sc.nextDouble();
System.out
.println(((x > 0 && y < 1) || (y > 0 && x < 4) || (x > 4 && y > 1)) ? "NO"
: "YES");
sc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment