Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <iostream>
- #include <set>
- #include <string>
- #include <vector>
- using namespace std;
- int Fibonacci(int x){
- if(x == 0){
- return 0;
- }
- if(x == 1){
- return 1;
- }
- return Fibonacci(x-1) + Fibonacci(x-2);
- }
- int main() {
- cout << Fibonacci(6) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement