#include<stdio.h>
#include<math.h>
void fun(double k2,double b2,double k3,double b3,double xf)
{int i,j;
double x[100],y[100];
x[0]=y[0]=0;
y[1]=0.8596;
for(i=1;x[i]>xf;i++)
{
x[i]=y[i]/(2.23-1.23*y[i]);
y[i+1]=k2*x[i]+b2;
printf("%lf\n",x[i]);
printf("%lf\n",y[i]);
}
printf("x[i]<xf 改用辰哥3号.\n");
for(j=i;y[j]>0.00001;j++)
{
y[j+1]=k3*x[j]-b3;
x[j+1]=y[j+1]/(2.23-1.23*y[j+1]);
printf("%lf\n",x[j]);
printf("%lf\n",y[j]);
}
}
main()
{
double k2,b2,k3,b3,xf;
scanf("%lf %lf %lf %lf %lf",&k2,&b2,&k3,&b3,&xf);
fun(k2,b2,k3,b3,xf);
}
为什么算不出来结果呢?