Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*4*/
- #include <iostream>
- using namespace std;
- int Fib(int n)
- {
- if (n == 0)
- return 0;
- if (n == 1)
- return 1;
- return Fib(n-1) + Fib(n-2);
- }
- int main()
- {
- int q;
- cin>>q;
- cout << Fib(q) << std::endl;
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement