Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int x;
- int fibR(int x){
- if ((x==1)||(x==2)) return 1; else return fibR(x-1)+fibR(x-2);
- }
- int main(){
- cin>>x;
- cout<<fibR(x);
- getchar();getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment