Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <iomanip>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL,"");
- double x, p=1, n=1, sum=0, f, eps;
- do
- {
- cout << "Введите x (0 < |x| < 1) : ";
- cin >> x;
- } while (abs(x) > 1);
- cout << "Введите точность (eps) : ";
- cin >> eps;
- f = 1 - (1 / pow(1+x,0.25));
- while (abs(p) > eps)
- {
- p *= pow(-1,2*n+1)*(((4*n-3)/(4*n))*x);
- sum += -p;
- n++;
- }
- cout << "Сумма ряда : " << setprecision(7) << sum;
- cout << "\nПроверка : " << setprecision(7) << f;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement