[구름] 피보나치 수

YongJun·2024년 12월 26일

[코딩테스트]

목록 보기
22/22

피보나치 수

a, b = 0, 1
k = int(input())
if k == 1: 
	print(a)
else:
	for i in range(2, k):
		a, b = b, a + b

	print(b % 1000000007)
profile
Student

0개의 댓글