AcWing 666. 三角形类型
原题链接
简单
foundamental
#include <iostream>
using namespace std;
double a , b , c , t;
int main()
{
cin >> a >> b >> c;
if (b > a)
{
t = a;
a = b;
b = t;
}
if (c > a)
{
t = a;
a = c;
c = t;
}
if (c > b)
{
t = b;
b = c;
c = 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 || b == c || c == a) cout << "TRIANGULO ISOSCELES" << endl;
}
return 0;
}