Guest User

Untitled

a guest
Feb 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int tri(double x, double y, double z)
  4. {
  5. if((x >= y + z || y >= x + z || z >= x + y) || (x <= 0 || y <= 0 || z <= 0))
  6. return 0;
  7. if(x == y && y == z)
  8. return 1;
  9. if((x == y && y != z) || (x == z && z != y) || (y == z && z != x))
  10. return 2;
  11. else
  12. return 3;
  13. }
  14.  
  15. int main(void)
  16. {
  17. double i;
  18. double j;
  19. double k;
  20. #if !MOOSHAK
  21. printf("Introduza as medidas do triangulo:\n");
  22. #endif
  23. scanf("%lf %lf %lf", &i, &j, &k);
  24. printf("%d\n", tri(i, j, k));
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment