놀이터
백준 java) #2480번 : 주사위 세개
Moonsu99
2023. 4. 6. 16:52
이 문제는 for문을 돌려서 풀 수도 있고, dice[ ]라는 배열을 생성하여 풀 수 도 있다.
이번에는 한 번 노가다로 풀어보았다.
참고로 이렇게 풀면 안된다. 정말 안좋은 코드이다.
*풀이
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){
System.out.println(10000+(a*1000));
} else if (a==b) {
System.out.println(1000+(a*100));
}else if(b==c){
System.out.println(1000+(b*100));
}else if(a==c){
System.out.println(1000+(c*100));
} else if (a != b && b !=c && a != c) {
if(a>b && a>c){
System.out.println(a*100);
}if (b>a && b>c){
System.out.println(b*100);
}if(c>a && c>b){
System.out.println(c*100);
}
}
}
}
*출력