-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDice.java
More file actions
46 lines (39 loc) · 820 Bytes
/
Copy pathDice.java
File metadata and controls
46 lines (39 loc) · 820 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
package quiz;
import java.util.Scanner;
public class Dice {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int A = 0;
int B = 0;
int C = 0;
int prize = 0;
int num = 0;
System.out.println("주사위 눈 수 입력");
A = scanner.nextInt();
B = scanner.nextInt();
C = scanner.nextInt();
if(A == B && B == C){
prize = 10000 + A * 1000;
}else if(A != B && B != C && A != C) {
for(int i = 0; i < 3; i++) {
if(i == 0) {
num = A;
}else {
if(num <B) {
num = B;
}else if(num < C) {
num = C;
}
}
prize = num * 100;
}
}else {
if(A == B) {
prize = A * 100 + 1000;
}else {
prize = B * 100 + 1000;
}
}
System.out.println(prize);
}
}