1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
if(a==b && b==c && c==a) { // 같은 눈이 3개일 경우
System.out.println(10000 + a * 1000);
}
else if(a==b || b==c) { // 같은 눈이 2개만 나올 경우(1)
System.out.println(1000 + b * 100);
}
else if(a==c) { // 같은 눈이 2개만 나올 경우(2)
System.out.println(1000 + a * 100);
}
else { // 모두 다른 눈이 나오는 경우
// System.out.println(Math.max(a, Math.max(b, c))* 100);
if(a>b && a>c) {
System.out.println(a * 100);
}
else if(b>a && b>c) {
System.out.println(b * 100);
}
else if(c>a && c>b) {
System.out.println(c * 100);
}
}
}
}
|
cs |
'Algorithm > 백준' 카테고리의 다른 글
백준 2439 (별 찍기 - 2) (0) | 2022.06.24 |
---|---|
백준 15552 (빠른 A+B) (0) | 2022.06.23 |
백준 2525 (오븐 시계) (0) | 2022.06.22 |
백준 2884 (알람 시계) (0) | 2022.06.21 |
백준 1152 (단어의 개수) (0) | 2022.06.19 |