include stdio include stdlib include math int main void int double 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
28
29
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{ int n=1;
double eps=1e-5,x,c=1,z,a,q,sum=0;
scanf("%lf", &x);
q=x;
while(fabs(a) > eps)
{ c*=x-1;
z=n*q;
a=c/z;
sum+=a;
n++;
q*=q;
}
printf("\n\n\n %lf\n", sum);
system("PAUSE");
return 0;
}