题解 | 绕距

绕距

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

#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

int main() 
{
  long double x[2],y[2];
  cin>>x[0]>>y[0];
  cin>>x[1]>>y[1];
  cout << setprecision(18) <<(fabs(x[0]-x[1]) + fabs(y[0]-y[1]) - hypot(x[0]-x[1], y[0]-y[1])) << endl;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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