AcWing 666. 三角形类型
原题链接
简单
作者:
赵珂欣
,
2024-11-14 23:36:22
,
所有人可见
,
阅读 1
#include <iostream>
using namespace std;
int main()
{
double A, B, C;
cin >> A >> B >> C;
if (B > A)
{
double t;
t = A;
A = B;
B = t;
}
if (C > A)
{
double t;
t = A;
A = C;
C = t;
}
if (C > B)
{
double t;
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 || A == C) cout << "TRIANGULO ISOSCELES" << endl;
}
return 0;
}