已累④
2025-08-06 19:58:02
发布于:广东
4阅读
0回复
0点赞
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
inline double fast_dist(double dx, double dy) {
return sqrt(dx*dx + dy*dy);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
double x[3], y[3];
cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
double a = fast_dist(x[0]-x[1], y[0]-y[1]);
double b = fast_dist(x[1]-x[2], y[1]-y[2]);
double c = fast_dist(x[2]-x[0], y[2]-y[0]);
cout << fixed << setprecision(2) << a+b+c;
return 0;
}
这里空空如也
有帮助,赞一个