首页 > 代码库 > 1007 Numerical Summation of a Series

1007 Numerical Summation of a Series

简单入门题。按照题目给的指导编程,算多少数要理解题意。

 1 #include <stdio.h> 2  3 int main(){ 4     int k; 5     double x,psix; 6     for(x=0;x<=2.000;x+=0.001){ 7         psix=0; 8         for(k=1;k<10000;k++) 9             psix += 1.0 / (k*(k+1)*(k+x));10         psix = psix*(1-x) + (1-x)/(2*10000*10000) + 1.0;11         printf("%5.3f %16.12f\n",x,psix);12     }13     return 0;14 }

 

1007 Numerical Summation of a Series