fork download
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <cmath>
  4. #include <iomanip>
  5. #include <stdlib.h>
  6. #include <iomanip>
  7. #define _USE_MATH_DEFINES
  8. #include <conio.h>
  9. #define PI 3.14159265
  10. using std::ios;
  11. using namespace std;
  12.  
  13.  
  14. int main()
  15. {
  16. setlocale(0, "");
  17. double e, Ch = 1, F, n = 0, a, x, dX, Xn, Xk, sim = 0;
  18.  
  19. cout << "Введите значения Хн Хк" << endl;
  20. cin >> Xn;
  21. cin >> Xk;
  22. cout << "Введите Е и и шаг" << endl;
  23. cin >> e;
  24. cin >> dX;
  25.  
  26. cout << setw(5) << setprecision(3) << "№X" << "|" << setw(9) << setprecision(3) << "Результат" << "|" << setw(8) << setprecision(3) << "Контроль" << "|" << endl;
  27.  
  28. for (x = Xn; x < Xk; x += dX)
  29. {
  30. n = 0;
  31.  
  32. F = PI / 2.0;
  33. Ch = x;
  34.  
  35. while (fabs(Ch) > e)
  36. {
  37. F += Ch;
  38. Ch *= (2 * n - 1)*pow(x, 2 * n + 1) / (2 * n*(2 * n + 1));
  39. n += 1;
  40. sim++;
  41. }
  42. a = asin(x);
  43. //cout<<" Значение х= "<< x <<" Значение F= "<< F << endl ;
  44. cout << setw(5) << setprecision(3) << x << "|" << setw(9) << setprecision(3) << F << "|" << setw(8) << setprecision(3) << a << "|" << sim << endl;
  45. //cout << "Контрольное значение Ф = " << a << endl;
  46. }
  47. system("pause");
  48. return 0;
  49. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
0.1 0.9
0.001 0.2
compilation info
prog.cpp:1:20: fatal error: stdafx.h: No such file or directory
 #include "stdafx.h"
                    ^
compilation terminated.
stdout
Standard output is empty