竞赛
考级
#include<bits/stdc++.h> using namespace std; double dis(double xa, double ya, double xb, double yb) { } int main() { double a,b,c,d,e,f; cin>>a>>b>>c>>d>>e>>f; double sum=dis(a,b,c,d)+dis(a,b,e,f)+dis(c,d,e,f); printf("%.2f",sum); }
AGGO互关
代码附有注释,已有缩进,直接复制即可
Banny
zyz610
x1,y1=map(float,input().split()) x2,y2=map(float,input().split()) x3,y3=map(float,input().split()) a1=((x2-x1)**2+(y2-y1)**2)**0.5 a2=((x3-x1)**2+(y3-y1)**2)**0.5 a3=((x3-x2)**2+(y3-y2)**2)**0.5 print("%.2f"%(a1+a2+a3))
广州珠江-大鸟老师
int n;
#include <iostream> #include <iomanip> #include <cmath> using namespace std; struct Point { double x, y; }; double distance(const Point& p1, const Point& p2) { return sqrt(pow(p2.x - p1.x, 2) + pow(p2.y - p1.y, 2)); } int main() { Point p1, p2, p3; }
龟龟仔仔🐢
WA君
#include <iostream> #include <iomanip> #include <cmath> using namespace std; struct Point { double x, y; }; // 计算两点之间的欧几里得距离 double distance(const Point& p1, const Point& p2) { return sqrt(pow(p2.x - p1.x, 2) + pow(p2.y - p1.y, 2)); } int main() { Point p1, p2, p3; }
深海的贝壳
读者
提交答案之后,这里将显示提交结果~