Advertisement
Guest User

gustavo

a guest
Apr 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.     double a,b,c,aux;
  5.     cin>>a>>b>>c;
  6.     if(a>b&&b>c)
  7.         a=a;
  8.     else if(b>a&&a>c){
  9.         aux=a;
  10.         a=b;
  11.         b=aux;
  12.     }else{
  13.         aux=a;
  14.         a=c;
  15.         c=aux;
  16.     }
  17.     if(a>=b+c)
  18.         cout<<"NAO FORMA TRIANGULO"<<endl;
  19.     else{
  20.     if(a*a==b*b+c*c)
  21.         cout<<"TRIANGULO RETANGULO"<<endl;
  22.     if(a*a>b*b+c*c)
  23.         cout<<"TRIANGULO OBTUSANGULO"<<endl;
  24.     if(a*a<b*b+c*c)
  25.         cout<<"TRIANGULO ACUTANGULO"<<endl;
  26.     if(a==b&&b==c)
  27.         cout<<"TRIANGULO EQUILATERO"<<endl;
  28.     if(a==b&&c!=a||c==b&&b!=a||a==c&&a!=b)
  29.         cout<<"TRIANGULO ISOSCELES"<<endl;
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement