题目内容

请编写一个函数fun(),它的功能是:根据以下公式求π的值(要求满足精度0.005,即某项小于0.005时停止迭代)。π/2=1+1/3+1*2/(3*5)+1*2*3/(3*5*7)+1*2*3*4/(3*5*7*9)+…+1*2*3*…*n/(3*5*7*…*(2n+1)) 程序运行后,如果输入精度0.0005,则程序输出3.14…。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。 试题程序: #include<conio.h> #include<math.h> double fun(double eps) main() double x; printf("Input eps: "); scanf("%1f", &x); printf("\neps=%1f,PI=%1f\n",x,fun(x));

查看答案
更多问题

London’s population of eleven million makes it the ______ largest city in the world.

Jessica had a plan to fake Bob on ______ of London the next day.

内脏小神经

书本是知识的重要来源。 2.但书本知识具有局限性。 3.因此……

答案查题题库