import java.util.ArrayList; import java.util.Arrays; import java.util.List; class fibonacci { private int previous=0; private int next=1; private List<integer> list = new ArrayList(Arrays.asList(previous, next)); public List<integer> fibonaccii(int a){ if(a result = f.fibonaccii(5); System.out.println(result); } } </integer></integer>
javac 斐波那契.java java 斐波那契.java
出: 尝试programiz.pro [0, 1, 1, 2, 3, 5]
以上是斐波那契的详细内容,请关注图灵教育的其他相关文章!