AcWing 666. 三角形类型
原题链接
简单
作者:
呆jio不
,
2024-11-07 15:48:56
,
所有人可见
,
阅读 1
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
double a,b,c;
cin>>a>>b>>c;
if(a<b) swap(a,b);
if(a<c) swap(a,c);
if(b<c) swap(b,c);
if(a>=b+c) cout<<"NAO FORMA TRIANGULO";
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;
}