#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
int main()
{
double xa,ya,xb,yb;
cin>>xa>>ya>>xb>>yb;
double c=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
cout<<fixed<<setprecision(3)<<c;
return 0;
}
1.3-16:计算线段长度
最新推荐文章于 2023-04-02 12:22:45 发布
这是一个简单的C++程序,用于计算两个二维坐标点之间的欧几里得距离。用户输入两个点的坐标,程序通过数学公式计算并输出精确到小数点后三位的结果。
15

被折叠的 条评论
为什么被折叠?



