如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
练习2、用函数实现数学表达式 #include<stdio.h>
#include<math.h>
doublefun1(doublex)
{
doubley=0.0;
y=(2.2-fabs(x))/(x*(x-1)+4.2)+0.6*x-2.2;
returny;
}
voidmain()
{
printf("fun1(1.66)=%.3lf\n",fun1(1.66));
}#include<math.h>
#include<stdio.h>
doublefun1(doublex)
{/**/
/**/
}
voidmain()
{
clrscr();
printf("fun1(0.76)=%8.3lf\n",fun1(0.76));
printf("fun1(3.00)=%8.3lf\n",fun1(3.00));
printf("fun1(3.76)=%8.3lf\n",fun1(3.76));
}
#include<math.h>
#include<stdio.h>
doublefun1(doublex)
{/**/
/**/
}
voidmain()
{
clrscr();
printf("fun1(0.76)=%8.3lf\n",fun1(0.76));
printf("fun1(3.00)=%8.3lf\n",fun1(3.00));
printf("fun1(3.76)=%8.3lf\n",fun1(3.76));
}#include<math.h>
#include<stdio.h>
doublefun1(doublex)
{
/**/
/**/
}
voidmain()
{
clrscr();
printf("fun1(0.76)=%8.3lf\n",fun1(0.76));
printf("fun1(3.00)=%8.3lf\n",fun1(3.00));
printf("fun1(3.76)=%8.3lf\n",fun1(3.76));
}#include<stdio.h>
#include<math.h>
doublef(floatx)
{
/**/
/**/
}
voidmain()
{
floatx;
doubley;
printf("Pleaseinputanumber:\n");
scanf("%f",&x);
y=f(x);
printf("f(%.3f)=%.3f\n",x,y);
getch();
}#include<stdio.h>
#include<math.h>
doublef(floatx)
{
/**/
/**/
}
voidmain()
{
floatx;
doubley;
printf("Pleaseinputanumber:\n");
scanf("%f",&x);
y=f(x);
printf("f(%0.2f)=%0.2f\n",x,y);
getch();
}
kp****93
实名认证
内容提供者
最近下载