Guest User

Untitled

a guest
Jan 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <math.h>
  4. using namespace std;
  5. char bufrus[256];
  6.  
  7.  
  8. char* Rus(const char* str){
  9. CharToOemA(str,bufrus);
  10. return bufrus;
  11. }
  12.  
  13. int main()
  14. {
  15. cout << Rus("Введи E: ");
  16. double E,x;
  17. cin >> E;
  18. cout << Rus("Введи x: ");
  19. cin >> x;
  20. double sinx = x;
  21. int factr = 3;
  22. int fact = 1*2*3;
  23.  
  24. double xxx = x*x*x;
  25. while(abs(xxx/fact)>E)
  26. {
  27. sinx = sinx + xxx/fact;
  28. xxx = xxx * x * x;
  29. fact = fact * (factr+1) * (factr+2);
  30. factr = factr + 2;
  31. }
  32. cout << Rus("ответ ") << sinx;
  33. cin.get();
  34. cin.get();
  35. return 0;
  36. }
Add Comment
Please, Sign In to add comment