백준 2480

hong030·2023년 1월 29일
0
  • solved.ac 기준 브론즈 4단계 문제

풀이)
if 문을 통해 접근할 수 있는 문제이다. 입력값이 많지 않고 한 줄만 입력하면 되므로 bufferedreader 대신 Scanner을 활용했다.

내 코드)

import java.util.Scanner;

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 && a==c)
			System.out.println(10000 + a*1000);
		else if (a==b) {
			System.out.println(1000 + a*100);
		}else if (a==c) {
			System.out.println(1000 + a*100);
		}else if (b==c) {
			System.out.println(1000 + c*100);
		}else {
			int max = a;
			if(max<b)
				max =b;
			if(max < c)
				max = c;
			System.out.println(max*100);

		}

	}
}
profile
자바 주력, 프론트 공부 중인 초보 개발자. / https://github.com/hongjaewonP

0개의 댓글