1 solutions

  • 0
    @ 2025-11-5 18:50:08

    C :

    #include<stdio.h>
    #include<math.h>
    #define S(x,y,z) (x+y+z)/2;
    #define area(x,y,z,S) sqrt(S*(S-x)*(S-y)*(S-z))
    main()
    {
    	double a,b,c,S;
    	scanf("%lf%lf%lf",&a,&b,&c);
    	S=S(a,b,c);
    	printf("%.3f\n",area(a,b,c,S));
    }
    

    C++ :

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

    Information

    ID
    19067
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By