本人初学者,问一下大神以下/**/ 、/**/空白处要填什么。。。最好做完运行一下正确后再发,关键语句帮忙注释一下,感激不尽!!
#include <stdio.h>
#include <conio.h>
double fun(float x)
{ /**/
/**/
}
void main()
{ float x;
printf("Please input a number: ");
scanf("%f",&x);
printf("fun(%.2f)=%.2f\n",x,fun(x));
getch();
}
#include <stdio.h>
#include <conio.h>
double fun(float x)
{ /**/
float 腊春y;
if(x<0)
y=2.50;
else if(x<10)
搏闷 y=0.3*x+2.51;
else
y=0.1*x+5.52;
return y;
/**/
}
void main()
{ 轮银耐float x;
printf("Please input a number: ");
scanf("%f",&x);
printf("fun(%.2f)=%.2f
",x,fun(x));
getch();
}
#include <stdio.h>
#include <conio.h>
double fun(float x)
{ /**/
if(x<0)
握启 {
段兆如 return 2.5;
}
if(x<10)
{
猜隐 return 0.3*x+2.51;
}
return 0.1*x+5.52;
/**/
}
void main()
{ float x;
printf("Please input a number: ");
scanf("%f",&x);
printf("fun(%.2f)=%.2f
",x,fun(x));
getch();
}