📄 fibonaccinumber.java
字号:
package com.macfaq.math;import java.math.BigInteger;public class FibonacciNumber { public static BigInteger calculate(int n) { if (n <= 0) { throw new IllegalArgumentException( "Fibonacci numbers are only defined for positive integers" ); } BigInteger low = BigInteger.ONE; BigInteger high = BigInteger.ONE; for (int i = 3; i <= n; i++) { BigInteger temp = high; high = high.add(low); low = temp; } return high; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -