Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <cmath> //для функциии asin
  4. using namespace std;
  5.  
  6. void main();
  7. {
  8. count<<"writeln x, N and E\n";
  9. int n;
  10. double x, E;
  11. cin>>x>>N>>E;
  12. if (x<=1) && (x>=-1)
  13. { // проверка на вычисление арксинуса
  14. double sum, factor, arcsinx; //сумма n элементов последовательности х, множитель перед х, арсинус
  15. acrsinx=asin(x); //вычисление арксинуса х
  16. sum=x; factor=1;
  17. int degree=1; //степень
  18. for (int i=2, i<=n, i++)
  19. {
  20. double factorx=1;
  21. factor=degree/(degree+1);
  22. degree=degree+2;
  23. for (int j=1, j<=degree, j++)
  24. factorx=factorx*x;
  25. factorx=factorx/degree;
  26. sum=sum+factor*factorx;
  27. }
  28. cout<<"summa";
  29. cout<<sum;
  30. cout<<"arcsin\n"<<arcsinx;
  31. }
  32. else cout<<"Error";
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement