search and replace ```\n< with ```\n\n< to ensure there's an empty line before closing tags
1.9 KiB
1.9 KiB
id, challengeType, title, videoUrl, localeTitle
id | challengeType | title | videoUrl | localeTitle |
---|---|---|---|---|
5900f3851000cf542c50fe98 | 5 | Problem 25: 1000-digit Fibonacci number | 问题25:1000位斐波纳契数 |
Description
F n = F n-1 + F n-2 ,其中F 1 = 1且F 2 = 1。
因此,前12个学期将是: F 1 = 1
F 2 = 1
F 3 = 2
F 4 = 3
F 5 = 5
F 6 = 8
F 7 = 13
F 8 = 21
F 9 = 34
F 10 = 55
F 11 = 89
F 12 = 144
Instructions
Tests
tests:
- text: <code>digitFibonacci(5)</code>应该返回21。
testString: assert.strictEqual(digitFibonacci(5), 21);
- text: <code>digitFibonacci(10)</code>应该返回45。
testString: assert.strictEqual(digitFibonacci(10), 45);
- text: <code>digitFibonacci(15)</code>应该返回69。
testString: assert.strictEqual(digitFibonacci(15), 69);
- text: <code>digitFibonacci(20)</code>应该返回93。
testString: assert.strictEqual(digitFibonacci(20), 93);
Challenge Seed
function digitFibonacci(n) {
// Good luck!
return n;
}
digitFibonacci(20);
Solution
// solution required
/section>