

이게 앞선 문제보다 난이도가 낮은 브론즈4 문제인데...저는 체감상 이게 더 어렵게 느껴졌습니다.
같은눈, 다른눈 변수를 각각 구별만 확실히 할 수 있다면 어렵지는 않아요.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int d1 = sc.nextInt();
int d2 = sc.nextInt();
int d3 = sc.nextInt();
int rst;
if (d1==d2 && d2==d3) {
rst = 10000+d1*1000;
System.out.println(rst);
}
else if ((d1 != d2 && d1 != d3) && d2 != d3) {
int max1;
if (d1>=d2 && d1>=d3) {
max1 = d1;
} else if (d2>=d1 && d2>=d3) {
max1 = d2;
} else {
max1 = d3;
}
rst = max1 * 100;
System.out.println(rst);
}
else {
int base1;
if (d1 == d2 || d1 == d3) {
base1 = d1;
}
else {
base1 = d2;
}
rst = 1000 + base1 * 100;
System.out.println(rst);
}
}
}'백준 문제풀이 > 조건문' 카테고리의 다른 글
| 2525. 오븐 시계 (0) | 2022.09.11 |
|---|---|
| 2884. 알람 시계 (0) | 2022.09.11 |
| 14681. 사분면 고르기 (0) | 2022.09.11 |
| 2753. 윤년 (0) | 2022.09.11 |
| 9498. 시험 성적 (0) | 2022.09.11 |