Advertisement
alexappelt

Untitled

Jul 20th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. #include<string.h>
  4. using namespace std;
  5.  
  6. int main(int argc, char const *argv[])
  7. {
  8.  
  9.  
  10. double x[3] , a=0, b=0, c=0, a2=0, b2=0, c2=0;
  11. int  i=0, j=0;
  12.  
  13. cin>>x[0]>>x[1]>>x[2];
  14.  
  15. sort(x,x+3);
  16.  
  17.  
  18. a=x[2];
  19. b=x[1];
  20. c=x[0];
  21. a2=pow(a,2.0);
  22. b2=pow(b,2.0);
  23. c2=pow(c,2.0);
  24.  
  25.  
  26.  
  27. if(a>=(b+c)){
  28.  
  29. for(i=0;i<1;i++){
  30. cout<<"NAO FORMA TRIANGULO"<<endl;
  31. }
  32. }
  33.  
  34. else{
  35. for(j=0;j<1;j++){
  36.  
  37. if(a2==(b2+c2)){
  38.     cout<<"TRIANGULO RETANGULO"<<endl;
  39. }
  40.  
  41. if(a2>(b2+c2)){
  42.     cout<<"TRIANGULO OBTUSANGULO"<<endl;
  43. }
  44.  
  45. if(a2<(b2+c2)){
  46.     cout<<"TRIANGULO ACUTANGULO"<<endl;
  47. }
  48.  
  49. if(a==b && b==c){
  50.     cout<<"TRIANGULO EQUILATERO"<<endl;
  51. }
  52.  
  53. if(a==b && b!=c){
  54.     cout<<"TRIANGULO ISOSCELES"<<endl;
  55. }
  56.  
  57. if(a==c && b!=c ){
  58.     cout<<"TRIANGULO ISOSCELES"<<endl;
  59. }
  60.  
  61. if(b==c && c!=a ){
  62.     cout<<"TRIANGULO ISOSCELES"<<endl;
  63. }
  64.  
  65.  
  66.  
  67. }
  68. }
  69.  
  70. return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement