人生第一道水题 计算两点间距离

在这里插入图片描述

#include<stdio.h>
#include<math.h>
int main()
{ 
    double x1,y1,x2,y2,s;
    while(scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2)!=EOF)
    {
    	s=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
	 	printf("%.2lf\n",s);
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_43434328/article/details/83615121