大家帮我看看,哪里不对了
# define M 510#include <stdio.h>
#include <math.h>
void main()
{ double x,T,a,j1,j2,x1,y1,x2,y2,x3,y3,x4,y4,j;
double i,c;
double f();
j1=52;
j2=40;
j=50;
printf("请输入扭矩稳定时的最低点的数值:\n");
scanf("f%,f%\n",&T,&a);
printf("请输入您的瞬时扭矩的数值:\n");
fflush(stdin);
printf("请输入4个初始点:\n");
scanf("f%,f%,f%,f%,f%,f%,f%,f%",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
if(T<a)
{
x=x1;
c=10;
while(c>=0.5)
{c=fabs(f(x,x1,y1,x2,y2,x3,y3,x4,y4)-T);
x++;};
c=f(x++,x1,y1,x2,y2,x3,y3,x4,y4);
i=1.5*(M-j*(j1-j2)*1.0/c);
printf("这是下一个时间段所对应的电流%f\n",i);}
if(T>=a)
{
i=1.5*(M-j*(j1-j2)*1.0/T);
printf("这是下一个时间段所对应的电流%f\n",i);
}
} double f( double x ,double x1, double y1 ,double x2 ,
double y2 ,double x3 ,double y3 ,double x4 ,double y4 )
{
return(((x-x1)*(x-x2)*(x-x3))/((x4-x1)*(x4-x2)*(x4-x3))*y4+
((x-x1)*(x-x2)*(x-x4))/((x3-x1)*(x3-x2)*(x3-x4))*y3+((x-x1)*(x-x4)*(x-x3))/((x2-x1)*(x2-x4)*(x2-x3))*y2+((x-x4)*(x-x2)*(x-x3))/((x1-x4)*(x1-x2)*(x1-x3))*y1);
}
结果都是一样的