1 条题解

  • 0
    @ 2024-12-22 11:03:57

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	double a,b,c;
    	cin>>a>>b>>c;
    	double q=(a+b+c)/2;
    	printf("%.2lf",sqrt(q*(q-a)*(q-b)*(q-c)));
    	return 0;
    }
    

    Python :

    # coding=utf-8
    x=float(input())
    y=float(input())
    z=float(input())
    p=(x+y+z)/2
    s=(p*(p-x)*(p-y)*(p-z))**0.5
    print(format(s,'.2f'))
    
    
    • 1

    信息

    ID
    117
    时间
    1000ms
    内存
    128MiB
    难度
    10
    标签
    (无)
    递交数
    3
    已通过
    0
    上传者