1 2 3 4 5 6 7 8 9 10 11 12 13
| #include<iostream> #include<iomanip> #include<cmath> #include<cstring> #include<algorithm> using namespace std; int main(){ double dist,x1,x2,x3,y1,y2,y3; cin>>x1>>y1>>x2>>y2>>x3>>y3; dist=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))+sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3))+sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3)); cout<<setprecision(2)<<fixed<<dist<<endl; return 0; }
|