1.根据以下函数关系,对输入的每个x值,计算出相应的y值,请填空使程序完整
main ( )
{
int x,c,m;
float y;
scanf(“%d”,&x);
if (________(1)________) c=-1;
else c=________(2)________ ;
switch (c) {
case –1 :y=0 ; break ;
case 0 :y=x ; break ;
case 1 :y=10 ; break ;
case 2 :
case 3 :y=-0.5*x+20 ; break ;
default :y=-2 ;
}
if (________(3)________)
printf (“y=%f”,y);
else
printf(“error!”);
}
人气:469 ℃ 时间:2020-06-08 03:24:02
解答
void writeto(link_stu H)
{
FILE *a;
link_stu p;
p=H->next;
a=fopen("stu.dat","w+");
fwrite(H,sizeof(lnode_stu),1,a);
while(p!=NULL)
{
fwrite(p,sizeof(lnode_stu),1,a);
p=p->next;
}
fclose(a);
推荐
- C语言程序:根据以下函数关系,对输入的每个x值,计算出相应的y值(程序填空)
- C语言:根据以下函数关系,对输入的每个x值,计算出相应的y值,请填(3)空使程序完整.
- (22) 有一函数,,以下程序段中不能根据x值正确计算出y值的是( ).
- 设函数f(x)=4^x/4^x+2,那么f(1/11)+f(2/11)+……+f(10/11)的值为?具体计算步骤
- C语言.有一个函数y=x(x
- 过去完成时标志词 五个
- 观察组数;5,10,15,20.第n个数为
- 两点确定一条直线 用命题的形式表示出来
猜你喜欢