본문 바로가기

[BOJ] - JAVA

[백준] 2480 : 주사위 세 개 JAVA 풀이

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int A = in.nextInt();
        int B = in.nextInt();
        int C = in.nextInt();
        
        if(A==B&&B==C){
            System.out.println(10000+(1000*A));
        }
        else if(A!=B&&B!=C&&A!=C){
            int max = Math.max(A, Math.max(B,C));
            System.out.println(100*max);  
        } 
        else{
            if(A!=B){
                System.out.println(1000+(100*C));
            }
            else if(A!=C){
                System.out.println(1000+(100*B));
            }
        }
    }
}