반응형
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt(); //x좌표
int y = sc.nextInt(); //y좌표
if(x>0 && y>0) {
System.out.println(1);
} else if(x>0 && y<0) {
System.out.println(4);
} else if(x<0 && y>0) {
System.out.println(2);
} else {
System.out.println(3);
}
}//main
}
반응형
'프로그래밍 > algorithm' 카테고리의 다른 글
11021번: A+B -7 (0) | 2020.11.14 |
---|---|
2742번 : 기찍N (0) | 2020.11.14 |
2884번: 알람시계 (0) | 2020.11.12 |
1541번: 잃어버린 괄호 (0) | 2020.11.11 |
11399번: ATM (0) | 2020.11.10 |