Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- int x, y;
- Scanner in = new Scanner(System.in);
- x = in.nextInt(); y = in.nextInt();
- if (x < 0 & y > 0) {
- System.out.println(2);
- }
- else if (x > 0 & y > 0) {
- System.out.println(1);
- }
- else if (x < 0 & y < 0) {
- System.out.println(3);
- }
- else if (x > 0 & y < 0) {
- System.out.println(4);
- }
- else {
- System.out.println("Введите координаты корректно");
- }
- }
- }
Add Comment
Please, Sign In to add comment