Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- double x, eps;
- double F=x, a=x;
- int n=0;
- cout << "Введите значение аргумента и точности:" << endl;
- cin >> x >> eps;
- while (fabs(a)<=eps)
- {
- a*=х*х/(n*2+1);
- F+=a;
- n++;
- }
- cout << "Приближенное значение arcth X=" << F;
- cout << "Точное значение arcth X=" << atanh(x) << endl; //atanh(x) = 1/2*((1+x)/(1-x))
- return 0;
- }
- 15:06:54 **** Incremental Build of configuration Debug for project Lr3 ****
- make all
- Building file: ../src/Lr3.cpp
- Invoking: Cross G++ Compiler
- g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Lr3.d" -MT"src/Lr3.d" -o "src/Lr3.o" "../src/Lr3.cpp"
- ../src/Lr3.cpp:22:3: error: stray ‘\321’ in program
- a*=х*х/(n*2+1);
- ^
- ../src/Lr3.cpp:22:3: error: stray ‘\205’ in program
- ../src/Lr3.cpp:22:3: error: stray ‘\321’ in program
- ../src/Lr3.cpp:22:3: error: stray ‘\205’ in program
- ../src/Lr3.cpp: In function ‘int main()’:
- ../src/Lr3.cpp:22:11: error: expected primary-expression before ‘/’ token
- a*=х*х/(n*2+1);
- ^
- make: *** [src/Lr3.o] Ошибка 1
Advertisement
Add Comment
Please, Sign In to add comment