#include<stdio.h>
int main()
{
int sign = 1;
double deno = 2.0, sum = 1.0, term;//deno分母,sum多项式,term分式
while (deno <= 100)
{
sign = -sign;
term = sign / deno;
sum = sum + term;
deno = deno + 1;
}
for(int deno=1;deno<=100;deno++){
sign = -sign;
term = sign / deno;
sum += term;
}
printf("%f\n",sum);
return 0;
}
标签:term,int,sum,sign,99,deno,100,2.0,2.4 From: https://blog.51cto.com/u_15804165/5724455