Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.omg.CORBA.MARSHAL;
- import org.omg.Messaging.SYNC_WITH_TRANSPORT;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner=new Scanner (System.in);
- boolean hasInsideCircle=false;
- boolean hasOutsideTriangle=false;
- Double x=Double.parseDouble(scanner.nextLine());
- Double y=Double.parseDouble(scanner.nextLine());
- Double x1=-1.0;
- Double x2=5.0;
- Double y1=1.0;
- Double y2=5.0;
- int radius=5;
- double dx=Math.abs(x-0);
- double dy= Math.abs(y-0);
- if(dx*dx+dy*dy<=radius*radius)
- {
- hasInsideCircle=true;
- }
- if ((x1 <= x && x2 >= x) && ((y1 <= y && y2 >= y)))
- {
- hasOutsideTriangle=false;
- }else {
- hasOutsideTriangle=true;
- }
- System.out.println(hasInsideCircle);
- System.out.println(hasOutsideTriangle);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment