while(scanf("%lf%lf%lf%lf",&x1,&x2,&y1,&y2)!=EOF);
你把坐标搞错啦..应该改成
while(scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2)!=EOF);
我编的过了,借你参考下
#include
#include
int main (void)
{
float x_1,x_2,y_1,y_2,d;
while((scanf("%f %f %f %f",&x_1,&y_1,&x_2,&y_2))==4)
{
d = sqrt((x_1-x_2)*(x_1-x_2)+(y_1-y_2)*(y_1-y_2));
printf("%.2f\n",d);
}
return 0;
}