공부하시는대에 도움이 됐으면 좋겠습니다.
답안코드 확인해주세요!
더보기
import java.util.Scanner;
public class Main {
public static String call(int input1, int input2) {
int big = 0, small=0;
if (input1 > input2) {
big = input1 / 2;
small = input2 * 2;
return Integer.toString(big) + " " + Integer.toString(small);
} else if (input1 < input2) {
big = input2 / 2;
small = input1 * 2;
return Integer.toString(small) + " " + Integer.toString(big);
}
return Integer.toString(small) + " " + Integer.toString(big);
}
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int input1 = in.nextInt();
int input2 = in.nextInt();
System.out.println(call(input1,input2));
}
}
댓글