Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double x;
- const double PI=3.141459265;
- double f(double i)
- {
- if (i<=1) return ((2*x)/(pow(x,2)-PI));
- else return (f(i-1)*((pow(x,2)-(i-1)*pow(PI,(i-1)))/(pow(x,2)-i*pow(PI,i))));
- }
- int main() {
- double n;
- double S;
- cout << "x = ";
- cin >> x;
- cout << "n = ";
- cin >> n;
- S=(1/x)+f(n);
- cout << "S = " << S;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement