1÷(1×2×3)+1÷(2×3×4)+1÷(3×4×5)+``````1÷(20×21×22)=

2024-12-15 18:31:40
推荐回答(1个)
回答1:

double fn(int n)
{
double f;
f = 1.0/(n*(n+1)*(n+2));
return f;
}
void main()
{
double sum = 0.0;
int i =0;
for(i=1;i<=20;i++)
{
sum = sum + fn(i);
}
printf("和是 %lf",sum);
getche();
}