Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int fibo(int n)
- {
- if (n <= 1)
- return n;
- else
- return fibo(n - 1) + fibo(n - 2);
- }
- int main()
- {
- int n;
- int s = 0;
- for (int i = 1; i <= 100; i++)
- s += fibo(i);
- cout << s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement