Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main() {
- std::locale::global(std::locale(""));
- double n = 1,add=0,x=0;
- cout << "Введите x: ";
- cin >> x;
- double e=0.001;
- double Sum = 0.0;
- do
- {
- add = pow(x, n) / n;
- Sum += add;
- n+=2;
- } while (abs(add) > e);
- cout << "Результат= " << Sum << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment