https://www.acmicpc.net/problem/14681


내 답안
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
int b = s.nextInt();
if (a>0 && b>0) {
System.out.println("1");
}
else if (a>0 && b<0) {
System.out.println("4");
}
else if (a<0 && b>0) {
System.out.println("2");
}
else System.out.println("3");
}
}
'Coding Test > 백준' 카테고리의 다른 글
[백준 2739번 - java] 구구단 (0) | 2021.11.03 |
---|---|
[백준 2884번 - java] 알람 시계 (0) | 2021.11.03 |
[백준 1330번 - java] 두 수 비교하기 (0) | 2021.11.03 |
[백준 9498번 - java] 시험 성적 (0) | 2021.11.03 |
[백준 2753번 - java] 윤년 (0) | 2021.11.03 |