预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共12页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

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(); }