2 条题解
-
1
*#include<bits/stdc++.h> using namespace std; double b(double x1,double y1,double x2,double y2){ double t1=pow (x2-x1,2); double t2=pow (y2-y1,2); return sqrt(t1+t2); } int main(){ double x1,x2,y1,y2,x3,y3,sss=0; cin>>x1>>y1>>x2>>y2>>x3>>y3; sss+=b( x1, y1, x2, y2); sss+=b( x3, y3, x2, y2); sss+=b( x1, y1, x3, y3); printf("%.1lf",sss); return 0; }
-
0
#include<bits/stdc++.h> using namespace std; double dist(double x1,double y1,double x2,double y2){ double t1=(x1-x2)(x1-x2); double t2=(y1-y2)(y1-y2); return sqrt(t1+t2); } int main(){ double x1,y1,x2,y2,x3,y3,ans=0; cin>>x1>>y1>>x2>>y2>>x3>>y3; ans=ans+dist(x1,y1,x2,y2); ans=ans+dist(x1,y1,x3,y3); ans=ans+dist(x2,y2,x3,y3); printf("%.2lf",ans); return 0; }
- 1
信息
- ID
- 2027
- 时间
- 1000ms
- 内存
- 125MiB
- 难度
- 4
- 标签
- (无)
- 递交数
- 163
- 已通过
- 70
- 上传者