1 条题解

  • 0
    @ 2025-12-5 12:25:25

    C :

    #include<stdio.h>
    #include<math.h>
    int main()
    {
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        int x1=a+b-c,x2=a+c-b,x3=b+c-a,x4=a+b+c;
        double ans=sqrt(x1*x2*x3*x4/16);
        printf("%.2f\n",ans);
        return 0;
    }
    
    

    C++ :

    #include<iostream>
    #include<cmath>
    using namespace std;
    int main()
    {
        float a,b,c,d,s;
        cin>>a>>b>>c;
        {
            d=(a+b+c)/2;
            s=sqrt(d*(d-a)*(d-c)*(d-b));
            cout.precision(2);
            cout.setf(ios::fixed);
            cout<<s<<endl;
        }
        return 0;
    }
    
    • 1

    信息

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