#include "stdio.h"
main()
{
float i,j,sum,n,m;
sum=0,j=1;m=1;
while(j<=100){
n=1/j;
sum=sum+m*n;
m=-m;
j++;
}
printf("最后结果为:%f",sum);
}
1-1/2+1/3……1/n(n<=100) (C语言)
猜你喜欢
转载自blog.csdn.net/Siren_dream/article/details/132504011
今日推荐
周排行