#include<stdio.h>
int main()
{
int a=1;
double b=2.0;
double sum=1.0;
while(b<=10)
{
a=-a;
sum=sum+a*(1/b);
b++;
}
printf("%f",sum);
return 0;
}
本文出自 “零点时光” 博客,请务必保留此出处http://10741764.blog.51cto.com/10731764/1700241