50pts求条
查看原帖
50pts求条
1431223
yuhaichen666楼主2025/1/26 19:04
#include<bits/stdc++.h>
using namespace std;
double x,y,X,Y,x3,y3,a,b,c;
int main(){
	cin>>x>>y>>X>>Y>>x3>>y3;
	a=fabs(sqrt((x-y)*(x-y)+(x3-y3)*(x3-y3)));
	b=fabs(sqrt((X-Y)*(X-Y)+(x3-y3)*(x3-y3)));
	c=fabs(sqrt((x-y)*(x-y)+(X-Y)*(X-Y)));
	double p=(a+b+c)/2;
	double s=sqrt(p*(p-a)*(p-b)*(p-c));
	cout<<fixed<<setprecision(2)<<s;
	return 0;
}
2025/1/26 19:04
加载中...