Advertisement
alias3glw

Triangulo

May 27th, 2015
1,435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  4.  
  5. int main(int argc, char** argv) {
  6.    
  7.     float a,b,c;
  8.    
  9.     cout<<"Ingrese el lado a"<<endl;
  10.     cin>>a;
  11.     cout<<"\nIngrese el lado b"<<endl;
  12.     cin>>b;
  13.     cout<<"\nIngrese el lado c"<<endl;
  14.     cin>>c;
  15.    
  16.     if ( a+b>c && a+c>b && c+b>a){
  17.        
  18.         if (a==b && a==c){
  19.             cout<<"\nEs triangulo equilatero"<<endl;
  20.         } else if ( a==b || a==c){
  21.             cout<<"\nEs triangulo Isoceles"<<endl;
  22.         }else if ( a!=b && a!=c){
  23.             cout<<"\nEs triangulo escaleno"<<endl;
  24.         }
  25.     }else{
  26.         cout<<"\No Existe un Triangulo con esas medidas"<<endl;
  27.     }
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement