Advertisement
dsdeep

URI 1045

Feb 18th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.01 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     double a,b,c,temp;
  5.     scanf("%lf %lf %lf",&a,&b,&c);
  6.     if(a>b&&a>c)
  7.     {
  8.         if(c>b)
  9.         {
  10.             temp=c;
  11.             c=b;
  12.             b=temp;
  13.         }
  14.     }
  15.     else if(b>a&&b>c)
  16.     {
  17.         temp=a;
  18.         a=b;
  19.         b=temp;
  20.  
  21.         if(c>b)
  22.         {
  23.             temp=c;
  24.             c=b;
  25.             b=temp;
  26.         }
  27.     }
  28.     else if(c>a&&c>b)
  29.     {
  30.         temp=a;
  31.         a=c;
  32.         c=temp;
  33.         if(c>b)
  34.         {
  35.             temp=c;
  36.             c=b;
  37.             b=temp;
  38.         }
  39.     }
  40.     if(a>=b+c)
  41.         printf("NAO FORMA TRIANGULO\n");
  42.     if(a*a==(b*b)+(c*c))
  43.         printf("TRIANGULO RETANGULO\n");
  44.     if(a*a>(b*b)+(c*c))
  45.         printf("TRIANGULO OBTUSANGULO\n");
  46.     if(a*a<(b*b)+(c*c))
  47.         printf("TRIANGULO ACUTANGULO\n");
  48.     if(a==b&&b==c&&c==a)
  49.         printf("TRIANGULO EQUILATERO\n");
  50.     if((a==b&&a!=c)||(b==c&&b!=a)||(c==a&&c!=b))
  51.         printf("TRIANGULO ISOSCELES\n");
  52.     return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement