공부하시는대에 도움이 됐으면 좋겠습니다.
답안코드 확인해주세요!
더보기
import java.util.Scanner;
public class Main {
public static int call(int original, int squared) {
int result = original;
for (int i = 1; i < squared; i++) {
result *= original;
}
if(squared == 0 )
result = 1;
return result;
}
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));
}
}
댓글