#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); }
#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); }