anon606

№6

Oct 14th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <conio.h>
  4.  
  5. void main()
  6. {
  7.    int n,x;
  8.    float sum;
  9.    sum = 0;
  10.    printf("Vvedite cherez probel n & x ");
  11.     scanf("%i%i",&n,&x);
  12.    for (int k = 1; k <= n; ++k)
  13.     sum = sum + ((pow(-1,k)*pow(x,k))/(pow(2*k+1,k)));
  14.    printf("%f",sum);
  15.    getch();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment