题解 | 绕距

绕距

https://www.nowcoder.com/practice/7a245fc6284f4139b4fb21de58e68483

#include<bits/stdc++.h>
using namespace std;
double paixu(double a,double b){
   return (a>b)? a-b:b-a;

}
int main() {
    int a,b,c,d;
    cin>>a>>b >>c>>d;
   double de,dm;
   de=sqrt(pow(a-c,2)+pow(d-b,2));
   dm=paixu(a,c)+paixu(b,d);
   cout<<fixed<<setprecision(16)<<paixu(de,dm);
   
   return 0;

}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

牛至超人:把哈工大,再加大加粗,看见闪闪发光的哈工大字样,面试官直接流口水
投递字节跳动等公司7个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务