1043 - Triangle

Problem Link


A Solution in c


#include<stdio.h>
int main()
{
    float A, B, C;
    scanf("%f %f %f", &A, &B, &C);
    if(A<B+C && B<A+C && C<A+B)
    {
        printf("Perimetro = %.1lf\n", A+B+C);
    }
    else
    {
        double D = 0.5 * (A+B) * C;
        printf("Area = %.1f\n", D);
    }
    return 0;
}





No comments

Theme images by Jason Morrow. Powered by Blogger.