monkeyslut45

Кирилл Деменев

Oct 28th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         int x, y;
  7.  
  8.         Scanner in = new Scanner(System.in);
  9.  
  10.         x = in.nextInt(); y = in.nextInt();
  11.  
  12.         if (x < 0 & y > 0) {
  13.             System.out.println(2);
  14.         }
  15.         else if (x > 0 & y > 0) {
  16.             System.out.println(1);
  17.         }
  18.         else if (x < 0 & y < 0) {
  19.             System.out.println(3);
  20.         }
  21.         else if (x > 0 & y < 0) {
  22.             System.out.println(4);
  23.         }
  24.         else {
  25.             System.out.println("Введите координаты корректно");
  26.         }
  27.  
  28.     }
  29. }
Add Comment
Please, Sign In to add comment