View Code of Problem 23

#include<iostream>
using namespace std;
int rabit(int m){
	if(m==1){
		return 1;
	}
	if(m==2){
		return 2;
	}
	return rabit(m-1)+rabit(m-2);
}
int main(){
	int m;
	while(cin>>m){
		cout<<rabit(m)<<"\n";	
	}
	return 0;
	
}

Double click to view unformatted code.


Back to problem 23