解题思路:
注意事项:
参考代码:
#include<stdio.h>
#include<math.h>
double fun(double x1,double y1,double x2,double y2)
{
double c;
c=sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
return c;
}
int main()
{
double x1, x2,y1, y2,JL;
while(scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2)!=EOF)
{
JL = fun(x1, y1, x2, y2);
printf("%.2lf\n", JL);
}
return 0;
}
0.0分
2 人评分