Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- float x = 0.0, y = 0.0, z = 0.0;
- printf("Digite o valor de x:\n");
- scanf("%f", &x);
- printf("Digite o valor de y:\n");
- scanf("%f", &y);
- printf("Digite o valor de z:\n");
- scanf("%f", &z);
- if((x < (y + z)) && (y < (x + z) && (z < (x + y)))){
- if(x == y && y == z){
- printf("Triangulo equilatero.\n");
- }else if((x == y && x != z) || (x == z && x != y)){
- printf("Triangulo isosceles.\n");
- }else if(x != y && x != z && y != z){
- printf("Triangulo escaleno.\n");
- }
- }else{
- printf("As medidas nao formam um triangulo.\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment