题目101 两点距离

来源:互联网 发布:php 商城 需求文档 编辑:程序博客网 时间:2024/05/11 15:29

     已AC代码:

 #include<cstdio>#include<cmath>using namespace std;int main(){    int t;    scanf("%d", &t);    while(t--)    {        double x1, y1, x2, y2;        double s;        scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2);        s = sqrt((x1-x2)*(x1-x2) +(y1-y2)*(y1-y2));        printf("%.2lf\n", s);    }    return 0;}        


0 0