#include
long func(long n)
{
if(n==0||n==1)return n;
else return func(n-1)+func(n-2);
}
main()
{
long n;
printf("please input n:");
scanf("%ld",&n);
printf("the result is %ld",func(n));
}
long Fib2(int n)
{ long int oneBack, twoBack, current;
int i;_
if(n == 0 || n == 1) return n;
else
{ oneBack = 1;
twoBack = 0;
for(i = 2; i <= n; i++)
{ current = oneBack + twoBack;
twoBack = oneBack;
oneBack = current;
}
return current;
}
}