求一道C语言的题目:当xy时 g(x,y)=f(x-y)/(x+y) 其中f(t)=(1+e^(-t))/(1+e^t)请帮我看看哪里错了,#include#includevoid main(){\x05float x,y,s;\x05printf("请输入x,y的值:");\x05scanf("%f,%f",&x,&y);\x05s=g(x,y);\x05printf("g(%f,%
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 06:01:16
求一道C语言的题目:当xy时 g(x,y)=f(x-y)/(x+y) 其中f(t)=(1+e^(-t))/(1+e^t)请帮我看看哪里错了,#include#includevoid main(){\x05float x,y,s;\x05printf("请输入x,y的值:");\x05scanf("%f,%f",&x,&y);\x05s=g(x,y);\x05printf("g(%f,%
求一道C语言的题目:当xy时 g(x,y)=f(x-y)/(x+y) 其中f(t)=(1+e^(-t))/(1+e^t)
请帮我看看哪里错了,
#include
#include
void main()
{
\x05float x,y,s;
\x05printf("请输入x,y的值:");
\x05scanf("%f,%f",&x,&y);
\x05s=g(x,y);
\x05printf("g(%f,%f)=%f\n",x,y,s);
}
float g(float x,float y)
{
\x05float s;
\x05if(x
求一道C语言的题目:当xy时 g(x,y)=f(x-y)/(x+y) 其中f(t)=(1+e^(-t))/(1+e^t)请帮我看看哪里错了,#include#includevoid main(){\x05float x,y,s;\x05printf("请输入x,y的值:");\x05scanf("%f,%f",&x,&y);\x05s=g(x,y);\x05printf("g(%f,%
主函数中调用float g(float x,float y)函数,而你在调用之前没有该函数的声明.
解决如下:
#include
#include
float g(float x,float y);
void main()
{
float x,y,s;
printf("请输入x,y的值:");
scanf("%f,%f",&x,&y);
s=g(x,y);
printf("g(%f,%f)=%f\n",x,y,s);
}
float g(float x,float y)
{
float s;
if(x