(精)最新c语言 编程题函数调用.docVIP

  • 10
  • 0
  • 约1.61千字
  • 约 4页
  • 2017-07-28 发布于河南
  • 举报
(精)最新c语言 编程题函数调用

编程题 #include math.h #include stdio.h #include conio.h double fun(double x) { /**/ return (cos(3*x)+x*x-1)/fabs(exp(x)-2*1/tan(x)+1); /**/ } void main() { double x; printf(Pleae input x:); scanf(%lf,x); printf(\nfun(%6.3lf) = %6.3lf\n,x,fun(x)); getch(); } return((cos(3*x)+x*x-1) /fabs(exp(x)-2*tan(x)+1) ); } #include stdio.h #include math.h #include conio.h double fun(float x) { /**/ /**/ } void main() { float x; double y; printf(Please input a number: ); scanf(%f,x); printf(f(%.2f)=%.2f\n,x,fun(x)); getch(); } 参考答案: if(x1000) return x; else if(x=1000x2000) return (

文档评论(0)

1亿VIP精品文档

相关文档