• HDU_2001——计算两点之间的距离


    Problem Description
    输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。
     
    Input
    输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。
     
    Output
    对于每组输入数据,输出一行,结果保留两位小数。
     
    Sample Input
    0 0 0 1 0 1 1 0
     
    Sample Output
    1.00 1.41
     
     1 #include <cstdio>
     2 #include <cmath>
     3 int main()
     4 {
     5    double x1,y1,x2,y2;
     6    while(~scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2))
     7       {
     8          printf("%.2lf\n",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));    
     9       }
    10    return 0;  
    11 }
    ——现在的努力是为了小时候吹过的牛B!!
  • 相关阅读:
    交换实验
    ISIS简单配置
    bgp联盟
    BGP2
    BGP 1
    BGP反射器
    ospf实验3
    bzoj 4503: 两个串
    bzoj 4259: 残缺的字符串
    COGS 2287. [HZOI 2015]疯狂的机器人
  • 原文地址:https://www.cnblogs.com/pingge/p/3138015.html
Copyright © 2020-2023  润新知