hdu2001

返回“大学生程序设计竞赛”

计算两点间的距离

http://acm.hdu.edu.cn/showproblem.php?pid=2001

/*written by czk*/
#include <stdio.h>
#include <math.h>

int main() {
    double x1, y1, x2, y2;
    while(scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2) != EOF)
        printf("%.2f\n", sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)));
}