Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int tri(double x, double y, double z)
- {
- if((x >= y + z || y >= x + z || z >= x + y) || (x <= 0 || y <= 0 || z <= 0))
- return 0;
- if(x == y && y == z)
- return 1;
- if((x == y && y != z) || (x == z && z != y) || (y == z && z != x))
- return 2;
- else
- return 3;
- }
- int main(void)
- {
- double i;
- double j;
- double k;
- #if !MOOSHAK
- printf("Introduza as medidas do triangulo:\n");
- #endif
- scanf("%lf %lf %lf", &i, &j, &k);
- printf("%d\n", tri(i, j, k));
- return 0;
- }
Add Comment
Please, Sign In to add comment