Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- static double rec(int n )
- {
- if (n < 1) return 0;
- return n == 1 ? 5 : rec(n - 1) /((n-1) * (n-1) + n);
- }
- int main()
- {
- int b1 = 5;
- int n;
- cout << " Enter number of element: ";
- cin >> n;
- double bn;
- bn = rec (n);
- if(bn == 0)
- cout << "Incorrect number of elements!";
- else cout << " n-elrment: " << bn;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement