본문 바로가기
알고리즘 & 자료구조/백준

벡준 10872

by 신재권 2021. 8. 16.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main10872 {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		
		System.out.println(factorial(N));
		
	}
	
	public static int factorial(int n){
		if(n  <= 1){
			return 1;
		}else{
			return factorial(n-1) * n;
		}
	
	}

}

'알고리즘 & 자료구조 > 백준' 카테고리의 다른 글

백준 9613  (0) 2021.08.17
백준 2004  (0) 2021.08.16
백준 1676  (0) 2021.08.16
백준 6588  (0) 2021.08.14
백준 1929  (0) 2021.08.12