Advertisement
Guest User

Untitled

a guest
Sep 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.31 KB | None | 0 0
  1.  
  2. /*
  3.  * To change this license header, choose License Headers in Project Properties.
  4.  * To change this template file, choose Tools | Templates
  5.  * and open the template in the editor.
  6.  */
  7. package lab1;
  8. import java.util.Scanner;
  9. import java.io.*;
  10. /**
  11.  *
  12.  * @author Сергей
  13.  */
  14. public class Lab1 {
  15.  
  16.     /**
  17.      * @param args the command line arguments
  18.      */
  19.     public static void main(String[] args) throws IOException{
  20.         double x,y;
  21.         BufferedReader in = new BufferedReader(
  22.             new InputStreamReader(System.in));
  23.         System.out.println("Введите x");
  24.         x = Double.parseDouble(in.readLine());
  25.         System.out.println("Введите y");
  26.         y = Double.parseDouble(in.readLine());
  27.        
  28.        
  29.         if (((x-7)*(x-7)+(y-7)*(y-7)==9) || (y == 1.75*x-2) || (y == (7.0/12)*x+1))
  30.                 System.out.println("Точка лежит на линии");
  31.         else if ((x-7)*(x-7)+(y-7)*(y-7)<9){
  32.                 if (y < 1.75*x-2){
  33.                     if (y > (7.0/12)*x+1){
  34.                         System.out.println("Область 3");
  35.                     }else
  36.                         if (y < (7.0/12)*x+1){
  37.                             System.out.println("Область 5");}
  38.                 }else
  39.                     if (y > (1.75*x)-2){
  40.                         System.out.println("Область 2");}
  41.             }else
  42.                 if ((x-7)*(x-7)+(y-7)*(y-7)>9){
  43.                     if (y > 1.75*x-2){
  44.                         if (y > (7.0/12)*x+1){
  45.                             System.out.println("Область 1");}
  46.                         else
  47.                             if (y < (7.0/12)*x+1){
  48.                                 System.out.println("Область 8");}
  49.                     }else
  50.                         if (y < 1.75*x-2){
  51.                             if (y < (7.0/12)*x+1)
  52.                                 System.out.println("Область 6");
  53.                             else
  54.                                 if (y > (7.0/12)*x+1){
  55.                                     if (x < 6)
  56.                                         System.out.println("Область 7");
  57.                                     else
  58.                                         System.out.println("Область 4");}}
  59.                 }
  60.             }
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement