문제

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


문제 풀이

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
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
       int a = sc.nextInt();
       int b = sc.nextInt();
       int c = sc.nextInt();

       //동전이 모두 다른경우
       if(a!=b && b!=c && c!=a){
           int max;
           if(a>b){
               if(c>a) max=c;
               else max = a;
           }else{
               if(c>b) max=c;
               else max=b;
           }
           System.out.println(max*100);
       }
       else{
           if(a==b && a==c){ //모두 같은경우
               System.out.println(10000+a*1000);
           }else{
               if(a==b || a==c){
                   System.out.println(1000 + a*100);
               }else System.out.println(1000 +b*100);   //b와 c가 같은경우
           }
       }
    }
}

카테고리:

업데이트:

댓글남기기