-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1045.c
More file actions
54 lines (42 loc) · 1.24 KB
/
1045.c
File metadata and controls
54 lines (42 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <stdio.h>
#include <math.h>
int main(){
float a, b, c, aux;
scanf("%f %f %f", &a, &b, &c);
if( (a > b) && (a > b) ){
a = a;
}else if( (b > a) && (b > c) ){
aux = a;
a = b;
b = aux;
}else if( (c > a) && (c > b) ){
aux = a;
a = c;
c = aux;
}
if(a >= b+c){
printf("NAO FORMA TRIANGULO\n");
}else if( pow(a,2) == pow(b,2) + pow(c,2) ){
printf("TRIANGULO RETANGULO\n");
if( (a == b) && (b == c) ){
printf("TRIANGULO EQUILATERO\n");
}else if( (a == b) || (b == c) || (a == c)){
printf("TRIANGULO ISOSCELES\n");
}
}else if( pow(a,2) > pow(b,2) + pow(c,2) ){
printf("TRIANGULO OBTUSANGULO\n");
if( (a == b) && (b == c) ){
printf("TRIANGULO EQUILATERO\n");
}else if( (a == b) || (b == c) || (a == c)){
printf("TRIANGULO ISOSCELES\n");
}
}else if( pow(a,2) < pow(b,2) + pow(c,2) ){
printf("TRIANGULO ACUTANGULO\n");
if( (a == b) && (b == c) ){
printf("TRIANGULO EQUILATERO\n");
}else if( (a == b) || (b == c) || (a == c)){
printf("TRIANGULO ISOSCELES\n");
}
}
return 0;
}