2021. 8. 24. 13:51
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static Main Main(){
return new Main();
}
public static int selectQuadrant(int x, int y){
int result = -1;
if (x > 0 && y > 0) {result = 1;}
if (x < 0 && y > 0) {result = 2;}
if (x < 0 && y < 0) {result = 3;}
if (x > 0 && y < 0) {result = 4;}
return result;
}
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(System.in);
int x = s.nextInt();
int y = s.nextInt();
System.out.println(selectQuadrant(x, y));
}
}
'AREA(지속적인 일상) > 02_백준' 카테고리의 다른 글
[백준] - 10871번 - X 보다 작은 수 (0) | 2021.08.25 |
---|---|
[백준] - 2884 - 알람 시계 (0) | 2021.08.24 |
[백준] - 2753 - 윤년 (0) | 2021.08.24 |
[백준] - 1330 대소 비교 (0) | 2021.08.24 |
[백준] 1009번 - 분산처리 (0) | 2021.08.24 |