计算两点间的距离
http://acm.hdu.edu.cn/showproblem.php?pid=2001
1
2 #include
3 #include
4
5 int main() {
6 double x1, y1, x2, y2;
7 while(scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2) != EOF)
8 printf("%.2f\n", sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)));
9 }
hdu2001 (2008-06-01 15:37:16由czk编辑)