Guest User

Untitled

a guest
May 26th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int func(float x, float y, float z)
  4. {
  5. float a,b,c;
  6. float tri;
  7.  
  8. a=x+y;
  9. b=x+z;
  10. c=y+z;
  11.  
  12. if(a>z || b>y || c>x)
  13. {
  14. if(x==y && x==z && y==z)
  15. {
  16. tri=1;
  17. }
  18. else
  19. {
  20. if((x==y && y==z) || (x==z && y==z) || (x==y && x==z))
  21. {
  22. tri=2;
  23. }
  24. if (x!=y && x!=z && y!=z )
  25. {
  26. tri=3;
  27. }
  28. }
  29. }
  30. return tri;
  31. }
  32.  
  33. int main()
  34. {
  35. float x,y,z;
  36. float tri;
  37. printf("Informe 3 valores reais: n");
  38. scanf("%f %f %f",&x,&y,&z);
  39.  
  40. tri=func(x,y,z);
  41.  
  42. if (tri==1)
  43. {
  44. printf("O triangulo eh escaleno.n");
  45. }
  46. if(tri==2)
  47. {
  48. printf("O triangulo eh isocelesn");
  49. }
  50. if(tri==3)
  51. {
  52. printf("O triangulo eh escalenon");
  53. }
  54.  
  55. return 0;
  56. }
Add Comment
Please, Sign In to add comment