GriefNorth

Untitled

Oct 31st, 2013
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. double x, eps;
  7. double F=x, a=x;
  8. int n=0;
  9. cout << "Введите значение аргумента и точности:" << endl;
  10. cin >> x >> eps;
  11.  
  12. while (fabs(a)<=eps)
  13. {
  14. a*=х*х/(n*2+1);
  15. F+=a;
  16. n++;
  17.  
  18. }
  19. cout << "Приближенное значение arcth X=" << F;
  20. cout << "Точное значение arcth X=" << atanh(x) << endl; //atanh(x) = 1/2*((1+x)/(1-x))
  21. return 0;
  22. }
  23.  
  24. 15:06:54 **** Incremental Build of configuration Debug for project Lr3 ****
  25. make all
  26. Building file: ../src/Lr3.cpp
  27. Invoking: Cross G++ Compiler
  28. 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"
  29. ../src/Lr3.cpp:22:3: error: stray ‘\321’ in program
  30. a*=х*х/(n*2+1);
  31. ^
  32. ../src/Lr3.cpp:22:3: error: stray ‘\205’ in program
  33. ../src/Lr3.cpp:22:3: error: stray ‘\321’ in program
  34. ../src/Lr3.cpp:22:3: error: stray ‘\205’ in program
  35. ../src/Lr3.cpp: In function ‘int main()’:
  36. ../src/Lr3.cpp:22:11: error: expected primary-expression before ‘/’ token
  37. a*=х*х/(n*2+1);
  38. ^
  39. make: *** [src/Lr3.o] Ошибка 1
Advertisement
Add Comment
Please, Sign In to add comment