(참고로 64bit long형 max 값은9223372036854775807대 충 920경....
그래서 자바에서는 BigInteger를 이용하여 간단하게 풀 수 있습니다
이는 java.math.BigInteger 를 import해서 사용하실 수 있습니다
1. n을 입력받는다
2. BigInteger 배열을 초기화 한다(i번째 idx : i번째 피보나치 수)
3. for문을 순회하며 이 전 두수를 더해주면서 다음 피보나치 수를 구해나가며 배열에 저장
코드는 아래를 참고해주세요!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters