Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. {int main(     )
  2. float x,y,z;
  3. cout<<"Inserire primo lato del triangolo"<<endl;
  4. cin>>x;
  5. cout<<"Inserire secondo lato del triangolo"<<endl;
  6. cin>>y;
  7. cout<<"Inserire terzo lato del triangolo"<<endl;
  8.  
  9. if (x>=y+z || y>=x+z || z>=x+y )
  10. { cout<<"Non si tratta di un triangolo"<<endl;
  11.   return 0}
  12. else
  13. {  if (x==y && y==z)
  14.    cout<<"Il triangolo è equilatero"<<endl;
  15.    else { if (x==y && z!=y)
  16.    cout<<"IL triangolo è isoscele"<<endl;
  17.    else { if (x!=y && y!=z)
  18.    cout<<"Il triangolo è scaleno"<<endl;
  19. }
  20. }
  21. }
  22. }
  23. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement