Advertisement
ivan179

code01

Nov 23rd, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <math.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. double x=-.5;
  11. double sum1=0;
  12. double sum2=0;
  13. double mn1=0;
  14. double mn2=0;
  15. mn1=(1+x)/(1-x);
  16. cout<<mn1<<endl;
  17. cout<<endl;
  18. sum1=log(mn1);
  19. for (int k=1;k<=100;k++){
  20. mn2=k*2-1;
  21. //cout<<mn<<",";
  22. sum2+=pow(x,mn2)/mn2;
  23.  
  24.  
  25. }
  26. cout<<endl;
  27. cout<<sum1<<endl;
  28. cout<<sum2*2<<endl;
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement