题目描述
blablabla
样例
#include <iostream>
using namespace std;
int main()
{
double a,b,c,t;
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 && a == c)
cout << "TRIANGULO EQUILATERO" << endl;
if ((a == b && a != c && b != c) || (a == c && a != b && c != b)|| (b == c && b != a && c != a))
cout << "TRIANGULO ISOSCELES" << endl;
}
return 0;
}
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla