[백준] 2480번 : 주사위 세개 - Java(자바)

강재원·2022년 9월 14일
0

[코딩테스트] Java

목록 보기
33/200



https://www.acmicpc.net/problem/2480

import java.util.*;
public class Main {
    public static void main(String args[]) {
        Scanner s=new Scanner(System.in);
        int a=s.nextInt();
        int b=s.nextInt();
        int c=s.nextInt();
        if(a==b&&b==c) System.out.format("%d",10000+a*1000);
        else if(a==b) System.out.format("%d",1000+a*100);
        else if(a==c) System.out.format("%d",1000+a*100);
        else if(b==c) System.out.format("%d",1000+b*100);
        else{
            int max=Math.max(a,Math.max(b,c));
            System.out.format("%d",max*100);
        }
    }
}
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글