/*读取表示三角形三条边的 3 个浮点数 A,B 和 C 并按降序排列,使 A 边是三边中最大的一边。
接下来,根据以下情况,确定它们可以组成的三角形类型:
如果 A≥B+C,则说明三条边不能构成三角形,请输出:NAO FORMA TRIANGULO
否则,说明三条边可以构成三角形,然后按如下情况输出:
如果A2=B2+C2,请输出:TRIANGULO RETANGULO
如果A2>B2+C2,请输出:TRIANGULO OBTUSANGULO
如果A2<B2+C2,请输出:TRIANGULO ACUTANGULO
如果三个边长度都相同,请输出:TRIANGULO EQUILATERO
如果只有两个边长度相同而第三个边长度不同,请输出:TRIANGULO ISOSCELES*/
include [HTML_REMOVED]
include [HTML_REMOVED]
int main(){
float A,B,C;
scanf(“%f%f%f”,&A,&B,&C);
float MAX,MIDDLE;
if(A>=B){
if(B<=C){
if(A<=C){
MAX = A;
MIDDLE = B;
A = C;
B = MAX;
C = MIDDLE;
//CAB
}
else{
MAX = B;
B = C;
C = MAX;
}
//ACB
}
}
else if(A<=B){
if(A<=C){
if(C>=B){
MAX = A;
A = C;
C = MAX;
}
//CBA
else if(B>=C){
MAX = A;
A = B;
B = C;
C = MAX;
}
//BCA
}
else if(A>=C){
MAX = A;
A = B;
B = MAX;
}
}
//printf("%f%f%f",A,B,C);
if(A>=B+C){
printf("NAO FORMA TRIANGULO\n");
}
else{
if(A*A == B*B+C*C){
printf("TRIANGULO RETANGULO\n");
if(A == B&&B == C&&C == A){
printf("TRIANGULO EQUILATERO\n");
}
else if((A == B&&B != C)||(A == C&&A != B)||(B == C&&C!=A)){
printf("TRIANGULO ISOSCELES\n");
}
}
else if(A*A>B*B+C*C){
printf("TRIANGULO OBTUSANGULO\n");
if(A == B&&B == C&&C == A){
printf("TRIANGULO EQUILATERO\n");
}
else if((A == B&&B != C)||(A == C&&A != B)||(B == C&&C!=A)){
printf("TRIANGULO ISOSCELES\n");
}
}
else if(A*A<B*B+C*C){
printf("TRIANGULO ACUTANGULO\n");
if(A == B&&B == C){
printf("TRIANGULO EQUILATERO\n");
}
else if((A == B&&B != C)||(A == C&&A != B)||(B == C&&C!=A)){
printf("TRIANGULO ISOSCELES\n");
}
}
}
}