ZOJ007 Numerical Summation of a Series(纯数学)

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double i;
    double k;
    for(i=0.000;i-2.000<=0.00000001;i+=0.001)
    {
        k=1;
        double sum=1+(1-i)/(2*10000*10000);
        while(k-10000<0)
        {
            sum+=(1-i)/(k*(k+i)*(k+1));
            k=k+1;
        }
        printf("%5.3lf %16.12lf\n",i,sum);
    }
    return 0;
}

 

posted @ 2020-02-15 12:09  zlc0405  阅读(197)  评论(0编辑  收藏  举报