666.三角形
作者:
不想考试
,
2024-11-14 23:23:39
,
所有人可见
,
阅读 1
#include<iostream>
using namespace std;
int main()
{
double a, b, c;
cin >> a >> b >> c;
//将a,b,c降序排序
if(b > a){
double t = b;
b = a;
a = t;
}
if(c > a){
double t = c;
c = a;
a = t;
}
if( c > b){
double t = c;
c = b;
b = t;
}
if( a >= b + c) cout << "NAO FORMA TRIANGULO" << endl;
else{
if(a * a == b * b + c * c) cout << "TRIANGULO RETANGULO" << endl;
if(a * a > b * b + c * c) cout << "TRIANGULO OBTUSANGULO" << endl;
if(a * a < b * b + c * c) cout << "TRIANGULO ACUTANGULO" << endl;
if( a == b && b == c) cout << "TRIANGULO EQUILATERO" << endl;
else if ( a == b || a == c || b == c ) cout << "TRIANGULO ISOSCELES" << endl;
}
return 0;
}