include stdio include stdlib include math int main void int float eps

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{ int n=1;
float eps=1e-5,x,c,z,a,sum=0;
scanf("%f", &x);
c=x-1;
z=n*x;
a=c/z;
while(fabsf(a) > eps)
{ c*=c;
x*=x;
sum+=a;
n++;
}
printf("%f\n", sum);
system("PAUSE");
return 0;
}