Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int func(float x, float y, float z)
- {
- float a,b,c;
- float tri;
- a=x+y;
- b=x+z;
- c=y+z;
- if(a>z || b>y || c>x)
- {
- if(x==y && x==z && y==z)
- {
- tri=1;
- }
- else
- {
- if((x==y && y==z) || (x==z && y==z) || (x==y && x==z))
- {
- tri=2;
- }
- if (x!=y && x!=z && y!=z )
- {
- tri=3;
- }
- }
- }
- return tri;
- }
- int main()
- {
- float x,y,z;
- float tri;
- printf("Informe 3 valores reais: n");
- scanf("%f %f %f",&x,&y,&z);
- tri=func(x,y,z);
- if (tri==1)
- {
- printf("O triangulo eh escaleno.n");
- }
- if(tri==2)
- {
- printf("O triangulo eh isocelesn");
- }
- if(tri==3)
- {
- printf("O triangulo eh escalenon");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment