历届c语言考试编程题 .pdfVIP

  • 7
  • 0
  • 约8.55千字
  • 约 12页
  • 2024-07-28 发布于中国
  • 举报

C语言编程题

第一题:

打开程序Cprog061.c,完成其中的fun(x)函数,使其计算:

{xx3

4-tg(3.8-x)3=x6

fun(x)=

4lgx-12x=6

#includestdio.h

#includemath.h

doublefun(floatx)

{

/**/

doubley;

if(x3)

y=x;

elseif(x=3x6)

y=4-tan(3.8-x);

else

y=4*log10(x)-12;

returny;

/**/

}

voidmain()

{

floatx;

doubley;

clrscr();

printf(Pleaseinputx:\n);

scanf(%f,x);

y=fun(x);

文档评论(0)

1亿VIP精品文档

相关文档