题解 | 三角形面积
三角形面积
https://www.nowcoder.com/practice/52992a1ac2b842cc84d3fd3813b9566d
#include<bits/stdc++.h>
using namespace std;
int main(){
int x1,x2,x3,y1,y2,y3;
cin >> x1>> y1;
cin >> x2 >> y2;
cin >> x3 >> y3;
double a = 0.5*abs((x2-x1)*(y3-y1) - (x3-x1)*(y2-y1)); // abs 不要忘了
cout << fixed<<setprecision(2) << a <<endl;
return 0;
}
