주사위 세개(2480)
조건에 따라 상금을 계산하는 문제
문제
입력
출력
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int fir = sc.nextInt();
int sec = sc.nextInt();
int thr = sc.nextInt();
int sum = 0;
if(fir == sec && sec == thr){
sum = 10000 + fir*1000;
} else if(fir == sec || fir == thr || sec == thr){
if(fir == sec){
sum = 1000 + fir*100;
} else if(fir == thr){
sum = 1000 + fir*100;
} else if(sec == thr){
sum = 1000 + sec*100;
}
} else if (fir != sec && sec != thr && thr != fir){
sum = Math.max(Math.max(fir, sec), thr)* 100;
}
System.out.println(sum);
}
}Last updated