【杭电】 2001 计算两点间的距离

来源:互联网 发布:db数据库怎么打开 编辑:程序博客网 时间:2024/09/21 09:06
#include <stdio.h>#include <math.h>int main(){    float x1,x2,y1,y2,s;    while(scanf("%f %f %f %f",&x1,&y1,&x2,&y2)!=EOF)    {    s=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));    printf("%.2f\n",s);    }}


0 0
原创粉丝点击