Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main (void)
- {
- double b1=0.5;
- double b2=0.2;
- int n;
- cin >> n;
- cout << b1 << " " << b2 << " ";
- for (int i=2; i<=n;i++)
- {
- double current;
- current = b2*b2+(b1/i);
- b1 = b2;
- b2 = current;
- cout << current << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment