

나중에 좌표 관련한 이해를 위해 나온 문제라고 해야하나,
저도 아직 배움이 짧아 뭐라 멘트를 쳐야할지 모르겠습니다.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
if (x>0 && y>0) {
System.out.println("1");
}
else if (x<0 && y>0) {
System.out.println("2");
}
else if (x<0 && y<0) {
System.out.println("3");
}
else {
System.out.println("4");
}
}
}'백준 문제풀이 > 조건문' 카테고리의 다른 글
| 2525. 오븐 시계 (0) | 2022.09.11 |
|---|---|
| 2884. 알람 시계 (0) | 2022.09.11 |
| 2753. 윤년 (0) | 2022.09.11 |
| 9498. 시험 성적 (0) | 2022.09.11 |
| 1330. 두 수 비교하기 (0) | 2022.09.11 |