Ad Code

Responsive Advertisement

1045 - Triangle Types

Author: Ismail Hosen

Daffodil International University





Problem Link

//Please follow from main function



#include <stdio.h>





int main()





{


    double a, b, c, temp;


    scanf("%lf %lf %lf", &a, &b, &c);


    if (a < b)


    {


        temp = a;


        a = b;


        b = temp;


    }


    if (b < c)


    {


        temp = b;


        b = c;


        c = temp;


    }


    if (a < b)


    {


        temp = a;


        a = b;


        b = temp;


    }


    if (a >= b + c)


    {


        printf("NAO FORMA TRIANGULO\n");


    }


    else if (a*a == b*b + c*c)


    {


        printf("TRIANGULO RETANGULO\n");


    }


    else if (a*a > b*b + c*c)


    {


        printf("TRIANGULO OBTUSANGULO\n");


    }


    else if (a*a < b*b + c*c)


    {


        printf("TRIANGULO ACUTANGULO\n");


    }


    if (a==b && b==c)


    {


        printf("TRIANGULO EQUILATERO\n");


    }


    else if (a==b || b==c)


    {


        printf("TRIANGULO ISOSCELES\n");


    }


    return 0;





}





Post a Comment

0 Comments