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