根据楼主的运行结果将scanf分成了两部分,且都是%lf的
#include<stdio.h>
#include<math.h>
int main(void)
{
double x,y;
printf("x=");
scanf("%lf",&x);
printf("y=");
scanf("%lf",&y);
if(x <= 2){
y = pow(x,3.5) + 2 - x + 1 / x;
}
if(x > 2){
y = pow(x,3.5) + x - 2 + 1 / x;
}
printf("y = %.2lf\n",y);
}
scanf("%f %f", &x,&y);
不知道你这个问题是否已经解决, 如果还没有解决的话: