팩토리얼

[Java]팩토리얼 - 재귀 함수
안녕하세요 코북입니다. 오늘은 팩토리얼 문제를 풀었는데, 반복문을 통해 푸는 방법과 재귀 함수를 사용해서 푸는 방법이 있었습니다. 반복문 풀이 public class Java08 { public static void main(String[] agrs) { Scanner sc = new Scanner(System.in); System.out.print("입력 : "); int num = sc.nextInt(); int fact = 1; //곱해야 하므로 기본값을 1로 설정 for(int i=2; i