fork download
  1. // Online C compiler to run C program online
  2. #include <stdio.h>
  3. #include <math.h>
  4.  
  5. int main() {
  6. double A, B, C, aux;
  7. scanf("%lf %lf %lf", &A, &B, &C);
  8.  
  9. if(B>A && B>C){ // B é maior
  10. aux = A;
  11. A = B;
  12. B = aux;
  13. }
  14. else{
  15. if(C>A && C>B){ // C é o maior
  16. aux = A;
  17. A = C;
  18. C = aux;
  19. }
  20. }
  21.  
  22. if(A>=B+C){
  23. printf("NAO FORMA TRIANGULO\n");
  24. }
  25. else{ // formam um triangulo
  26. if(A*A==B*B+C*C){
  27. printf("TRIANGULO RETANGULO");
  28. }
  29. if(A*A>B*B+C*C){
  30. printf("TRIANGULO OBTUSANGULO\n");
  31. }
  32. if(A*A<B*B+C*C){
  33. printf("TRIANGULO ACUTANGULO\n");
  34. }
  35.  
  36. if(A==B && B==C && A==C){
  37. printf("TRIANGULO EQUILATERO\n");
  38. }
  39. else{
  40. if(A==B || B==C || A==C){
  41. printf("TRIANGULO ISOSCELES\n");
  42. }
  43. }
  44. }
  45.  
  46. return 0;
  47. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
TRIANGULO RETANGULO