Study📚/백준

[백준] - #2480: 주사위 세개

woo!na 2024. 5. 13. 13:57

문제 출처 : https://www.acmicpc.net/

 


#2480: 주사위 세개 (언어 : Java11)


제출 답안

import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a,b,c;
        int max=0;
        a=sc.nextInt();
        b=sc.nextInt();
        c=sc.nextInt();
        
        if (a==b && b==c)
            System.out.print(10000+a*1000);
        else if (a==b && b!=c)
            System.out.print(1000+a*100);
        else if (b==c && c!=a)
            System.out.print(1000+b*100);
        else if (c==a && a!=b)
            System.out.print(1000+c*100);
        else{
            if (a>b && a>c)
                System.out.print(a*100);
            else if (b>a && b>c)
                System.out.print(b*100);
            else
                System.out.print(c*100);
        }
        
    }
}

comment

- if문이 너무 많아서 굉장히 신경쓰임...

'Study📚 > 백준' 카테고리의 다른 글

[백준] - #10807: 개수 세기  (0) 2024.05.13
[백준] - #10998: AxB  (0) 2024.05.13
[백준] - #2588: 곱셈  (0) 2024.05.13
[백준] - #2753: 윤년  (0) 2024.05.13
[백준] - #2884: 알람 시계  (0) 2024.05.13