fork download
  1. include <cmath>
  2. #include <iostream>
  3. #include <iostream>
  4. #include <cmath>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. double x, t, S, e; //ввод данных;
  10. int k;
  11. cout << "x and eps" << endl;
  12. cin >> x >> e;
  13. t = 1;
  14. S = t;
  15. k = 1;
  16. printf("%4c%10c%11c\n", 'k', 't', 'S');
  17. printf("%4d%15e%15.8f\n", k - 1, t, S);
  18. while (fabs(t) > e)
  19. {t = pow(x + 1, 2) / k*t;
  20. S = S + t;
  21. printf("%4d%15e%15.8f\n", k, t, S);
  22. k++;
  23. }
  24. printf("%2s%15.8f\n","s=", S);
  25. system("pause");
  26. return 0;
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1: error: expected constructor, destructor, or type conversion before '<' token
prog.cpp: In function 'int main()':
prog.cpp:25: error: 'system' was not declared in this scope
stdout
Standard output is empty