欢迎来到天天文库
浏览记录
ID:41876594
大小:198.50 KB
页数:12页
时间:2019-09-04
《C语言真题讲解》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、练习2、用函数实现数学表达式编写函数求2.2-│x│fun1(x)=──────+0.6x-2.2x(x-1)+4.2在main()函数中调用fun1函数#include#includedoublefun1(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",fun1(1.66));}#include#includedoublefun1(d
2、oublex){/**//**/}voidmain(){clrscr();printf("fun1(0.76)=%8.3lf",fun1(0.76));printf("fun1(3.00)=%8.3lf",fun1(3.00));printf("fun1(3.76)=%8.3lf",fun1(3.76));}#include#includedoublefun1(doublex){/**//**/}voidmain(){clrscr();printf("fun1(0.76)=%8.3lf",fun1(0.76));prin
3、tf("fun1(3.00)=%8.3lf",fun1(3.00));printf("fun1(3.76)=%8.3lf",fun1(3.76));}#include#includedoublefun1(doublex){/**//**/}voidmain(){clrscr();printf("fun1(0.76)=%8.3lf",fun1(0.76));printf("fun1(3.00)=%8.3lf",fun1(3.00));printf("fun1(3.76)=%8.3lf",fun1(3.76));}f(x
4、)=#include#includedoublef(floatx){/**//**/}voidmain(){floatx;doubley;printf("Pleaseinputanumber:");scanf("%f",&x);y=f(x);printf("f(%.3f)=%.3f",x,y);getch();}#include#includedoublef(floatx){/**//**/}voidmain(){floatx;doubley;printf("Pleaseinputanumber
5、:");scanf("%f",&x);y=f(x);printf("f(%0.2f)=%0.2f",x,y);getch();}
此文档下载收益归作者所有