Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int fib(int n) {
- if (n == 1) {
- return 1;
- }
- if (n == 0) {
- return 0;
- }
- return fib(n - 1) + fib(n - 2);
- }
- int task14() {
- int n;
- cin >> n;
- cout << fib(n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement