一道数学题,求大神看看错在哪里?
#include<stdio.h>#include<math.h>
float f(float x){
float a;
a=(exp(x)-fabs(x-12.0))/(x+10*cos(x-1));
return a;
}
float g(float x)
{
float b;
if(x<0)
b=1/(x*x)
else if (x=0)
b=0;
elseb=log(x*x+5);
return b;
}
void main()
{
float y;
y=0.0;
int c;
float d=0.0;
for(c=1;c<=4;)
{
y=(4.0*f(c*c)/((f(c/2)-1)))-3*g(t*t+2);
d=y+b;
c++;
}
}
printf("%f",d);