#include <iostream>
using namespace std;
int fib(int n);
int main()
{
int a;
while(cin>>a)
{
cout<<"the result: "<<fib(a)<<endl;
}
return 0;
}
int fib(int n)
{
if(n==1||n==2)
return 1;
else
return fib(n-1)+fib(n-2);
}
转载于:https://www.cnblogs.com/liesun/p/7350336.html