package com;
import java.util.Arrays;
public class Fibo {
public int[] fibo(int num){
int fibo[]=new int[num];
fibo[0]=1;
fibo[1]=1;
for(int i=2;i<num;i++){
fibo[i]=fibo[i-2]+fibo[i-1];
}return fibo;
}
public static void main(String[]args){
Fibo fibo=new Fibo();
int []arrs=fibo.fibo(10);
System.out.println(Arrays.toString(arrs));
}
}
原文:https://www.cnblogs.com/hhc16619804375/p/14297243.html