我想知道为什么当我只要求两个参数时我的 scanf 会继续运行?
do {
scanf("%f %f\n", &a,&b);
printf("a=%f; b=%f;\n",a,b);
printf("f(a)=%f; f(b)=%f; f(a)*f(b)=%f;\n",f(a),f(b),f(a)*f(b));
}
while(a>=b || f(a)*f(b)>=0);
1
2
3
a=1.000000; b=2.000000;
f(a)=-3.281718; f(b)=-0.610944; f(a)*f(b)=2.004947;
1 5
a=3.000000; b=1.000000;
f(a)=10.085535; f(b)=-3.281718; f(a)*f(b)=-33.097884;
先感谢您