杭电2001----计算两点间的距离

1 #include<stdio.h>
2 #include<math.h>
3 int main()
4 {
5     double x1,x2,y1,y2;
6     while(~scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2))
7         printf("%.2lf\n",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));
8     return 0;
9 }

 

posted @ 2016-11-07 12:58  Posase  阅读(155)  评论(0编辑  收藏  举报