publicclassMain{publicstaticvoiddigui(int n){//递归求第n个斐波那契数if(n<=1){
t = n;}else{
t =test01(n-1)+test01(n-2);}return t;}publicstaticvoidnodigui(int n){//非递归求第n个斐波那契数int j =0;int a =1,b =1,t =0;if(n==0)return0;if(n==1||n==2)return1;
j = n-1;while(j>2){
t = a;
a = a + b;
b = t;
j--;}return(a+b);}}