public class FactorialTest {
public static int factorialRun(int num) {
if (num == 1){
return 1;
}
else{
//Fcatorial 값 출력
System.out.println("factorial(" + num + ")");
return factorial(num - 1) * num;
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("숫자 입력 : ");
int num = sc.nextInt();
System.out.println(factorialRun(num));
}
}