80求助!!!
查看原帖
80求助!!!
561043
足球小子楼主2023/3/21 21:53
#include<bits/stdc++.h>
using namespace std;

double work(int x1,int y1,int x2,int y2)
{
	return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
}

int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	double x1,y1,x2,y2,x3,y3;
	cin>>x1>>y1>>x2>>y2>>x3>>y3;
	double sum=0;
	sum+=work(x1,y1,x2,y2)+work(x1,y1,x3,y3)+work(x2,y2,x3,y3);
	cout<<fixed<<setprecision(2)<<sum;
	return 0;
}

2023/3/21 21:53
加载中...