1 条题解
-
1
#include #include #include using namespace std; double f(double x1,double y1,double x2,double y2){ return sqrt((x1-x2)(x1-x2)+(y1-y2)(y1-y2)); } double area(double a,double b,double c){ double p=(a+b+c)/2; return sqrt(p*(p-a)(p-b)(p-c)); } int main(){ double x1,y1,x2,y2,x3,y3; cin>>x1>>y1>>x2>>y2>>x3>>y3; double a,b,c; a = f(x1,y1,x2,y2); b = f(x2,y2,x3,y3); c = f(x3,y3,x1,y1); printf("%.2lf\n",area(a,b,c)); return 0; }
- 1
信息
- ID
- 34
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 8
- 标签
- (无)
- 递交数
- 27
- 已通过
- 6
- 上传者