Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package lab1;
- import java.util.Scanner;
- import java.io.*;
- /**
- *
- * @author Сергей
- */
- public class Lab1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws IOException{
- double x,y;
- BufferedReader in = new BufferedReader(
- new InputStreamReader(System.in));
- System.out.println("Введите x");
- x = Double.parseDouble(in.readLine());
- System.out.println("Введите y");
- y = Double.parseDouble(in.readLine());
- if (((x-7)*(x-7)+(y-7)*(y-7)==9) || (y == 1.75*x-2) || (y == (7.0/12)*x+1))
- System.out.println("Точка лежит на линии");
- else if ((x-7)*(x-7)+(y-7)*(y-7)<9){
- if (y < 1.75*x-2){
- if (y > (7.0/12)*x+1){
- System.out.println("Область 3");
- }else
- if (y < (7.0/12)*x+1){
- System.out.println("Область 5");}
- }else
- if (y > (1.75*x)-2){
- System.out.println("Область 2");}
- }else
- if ((x-7)*(x-7)+(y-7)*(y-7)>9){
- if (y > 1.75*x-2){
- if (y > (7.0/12)*x+1){
- System.out.println("Область 1");}
- else
- if (y < (7.0/12)*x+1){
- System.out.println("Область 8");}
- }else
- if (y < 1.75*x-2){
- if (y < (7.0/12)*x+1)
- System.out.println("Область 6");
- else
- if (y > (7.0/12)*x+1){
- if (x < 6)
- System.out.println("Область 7");
- else
- System.out.println("Область 4");}}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement