编程题:编写函数fun,使其完成如下数学表达式的计算.sample11.c例如:fun(5.16)= 1.006fun(16.32)= 18.170#include <stdio.h>#include<math.h>double fun(double x){ }main(){ printf("fun(5.16)=%8.3f\n"
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/22 02:11:27
编程题:编写函数fun,使其完成如下数学表达式的计算.sample11.c例如:fun(5.16)= 1.006fun(16.32)= 18.170#include <stdio.h>#include<math.h>double fun(double x){ }main(){ printf("fun(5.16)=%8.3f\n"
编程题:编写函数fun,使其完成如下数学表达式的计算.sample11.c
例如:fun(5.16)= 1.006
fun(16.32)= 18.170
#include <stdio.h>
#include<math.h>
double fun(double x)
{
}
main()
{
printf("fun(5.16)=%8.3f\n",fun(5.16));
printf("fun(16.32)=%8.3f\n",fun(16.32));
}
编程题:编写函数fun,使其完成如下数学表达式的计算.sample11.c例如:fun(5.16)= 1.006fun(16.32)= 18.170#include <stdio.h>#include<math.h>double fun(double x){ }main(){ printf("fun(5.16)=%8.3f\n"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double fun(double x)
{
\x09if(x<10)
\x09{
\x09\x09double t = 1-exp(-1*x);
\x09\x09if(t){
\x09\x09\x09return 1/t;
\x09\x09}
\x09\x09return 0x8FFFFFFF;//无穷大
\x09}
\x09else
\x09\x09return (x+3)*sin(2*x);
}
int main()
{
\x09printf("%8.3lf\n", fun(5.16));
\x09printf("%8.3lf\n", fun(16.32));
\x09system("pause");
\x09return 0;
}