Skip to content

Commit cdb79b8

Browse files
committed
[BOJ] 피보나치 수 5 / 브론즈2 / 5분
https://www.acmicpc.net/problem/10870
1 parent 2fef2b3 commit cdb79b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sys
2+
3+
def fib(n):
4+
if n == 0:
5+
return 0
6+
if n == 1:
7+
return 1
8+
9+
return fib(n-1) + fib(n-2)
10+
11+
inp = sys.stdin.readline
12+
13+
n = int(inp())
14+
15+
print(fib(n))

0 commit comments

Comments
 (0)