Skip to content

Commit f73d03b

Browse files
committed
[BOJ] 팩토리얼 2 / 브론즈 V / 12분
https://www.acmicpc.net/problem/27433
1 parent b404b7a commit f73d03b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

JYP/팩토리얼 2.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def fac(n):
2+
if n <= 1: # 종료조건
3+
ans = 1
4+
else:
5+
ans = fac(n-1) * n # 재귀
6+
7+
return ans
8+
9+
print(fac(int(input())))

0 commit comments

Comments
 (0)