大佬们,我这哪有问题啊,洛谷一直给的compile error
查看原帖
大佬们,我这哪有问题啊,洛谷一直给的compile error
1445147
Aphasia3517650240楼主2024/10/20 16:45
#include<iostream>
#include<iomanip>
using namespace std;
int main() {
	double x1, y1, x2, y2, x3, y3, p, a, b, c,s;
	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
	a = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
	b = sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3));
	c = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
	p = (a + b + c) / 2;
	cout << fixed << setprecision(2) << sqrt(p * (p - a)*(p - b)*(p - c)) << endl;
	return 0;
}


2024/10/20 16:45
加载中...