#include
#include
int main()
{
float x1,y1,x2,y2;
scanf("%f,%f",&x1,&y1);
scanf("%f,%f",&x2,&y2);
printf("%.3f\n",sqrt( (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) );
return 0;
}
P.S. 输入的时候注意要加逗号
#include
#include
int main()
{double x1,y1,x2,y3,d;
scanf("%lf,%lf",&x1,&y1);
scanf("%lf,%lf",&x2,&y2);
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
printf("%.3lf\n"d);
return 0;
}