Advertisement
myloyo

4.12

Nov 6th, 2022 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main()
  5. {
  6.     double b1 = 0.5, b2 = 0.2, b;
  7.     int n;
  8.     cin >> n;
  9.     for (int i = 3; i <= n; i++) {
  10.         b = (pow(b2, 2) + b1 / (i-1));
  11.         b1 = b2;
  12.         b2 = b;
  13.         cout << "i = " << i << "  "<< b << endl;
  14.     }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement