1 条题解

  • 0
    @ 2023-10-1 15:25:29
    #include<iostream>
    #include<cstdio>
    #include<cmath>
    #include<algorithm>
    using namespace std;
    int main(){
    	double x1,y1,x2,y2,x3,y3,ab,ac,bc,p,s;
    	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    	ab = sqrt(pow(x1-x2,2)+pow(y1-y2,2));
    	ac = sqrt(pow(x1-x3,2)+pow(y1-y3,2));
    	bc = sqrt(pow(x2-x3,2)+pow(y2-y3,2));
    	p = (ab+ac+bc)*1.0/2;
    	s = sqrt(p*(p-ab)*(p-bc)*(p-ac));
    	printf("%.2lf",s);
    	return 0;
    }
    
    • 1

    信息

    ID
    6843
    时间
    1000ms
    内存
    128MiB
    难度
    1
    标签
    (无)
    递交数
    30
    已通过
    25
    上传者