#include<stdio.h>
int main()
{
float sign,n,sum;
sign=1;
sum=1;
for(n=2;n<=100;n++)
{
sign=(-1)*sign;
sum=sum+(1/n)*sign;
}
printf("%f",sum);
return 0;
}
C 求1-1/2+1/3-1/4+……+1/99-1/100
于 2023-07-26 15:48:21 首次发布