我做了这样一个程序.做是做好了,但发现有些问题.请高手帮我看看,求一元一次方程的.
main(void)
{
double count(double a,double b,double x);
double a,x,b,y;
printf("求一元一次函数ax+b=y\n");
printf("请输入a的值:");
scanf("%lf",&a);
printf("请输入b的值:");
scanf("%lf",&b);
if(a=0)
{
printf("y=b=%.2f",b);
return 0;
}
else
{
printf("请输入x的值:");
y=count(a,b,x);
printf("y=%.2f*%.2f+%.2f=%.2f",a,x,b,y);
}
return 0;
}
double count(double a,double b,double x)
{
double y;
y=a*x+b;
return y;
}