#include
using namespace std;
int main() {
double x;
double xn = 1;
int m;
double eps = 0.001;
int f = 1;
int mn = 1;
int i = 0;
double an = 1;
double s = 1;
cout << "x = ";<br> cin >> x;
cout << "m = ";<br> cin >> m;
while (an mn = mn*(m-i);
i++;
f = f*i;
xn = xn*x;
an = mn*xn/f;
s = s+an;
}
cout << "S = " << s;<br> return 0;
}
Пример:
x = 0.2
m = 5
S = 2.48832