https://www.acmicpc.net/problem/10872
def fac(n):
result = 1
if n > 0 :
result = n * fac(n-1)
return result
n = int(input())
print(fac(n))
'고전컴퓨터 > 문제 풀이(with Python)' 카테고리의 다른 글
[재귀함수] 백준 10870 피보나치 수 5 (0) | 2022.01.04 |
---|
https://www.acmicpc.net/problem/10872
def fac(n):
result = 1
if n > 0 :
result = n * fac(n-1)
return result
n = int(input())
print(fac(n))
[재귀함수] 백준 10870 피보나치 수 5 (0) | 2022.01.04 |
---|