AcWing 666. 三角形类型
原题链接
困难
作者:
Value
,
2020-09-08 19:49:47
,
所有人可见
,
阅读 337
!等腰和等边输出一个即可
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double a, b, c; cin >> a >> b >> c;
double maxv, minv;
maxv = -1, minv = 100;
maxv = max(a, max(b, c)), minv = min(a, min(b, c));
b += a + c;
a = maxv, c = minv, b -= (a + c);
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;
else cout << "TRIANGULO ACUTANGULO" << endl;
if(a == b && b == c) cout << "TRIANGULO EQUILATERO" << endl;
else if(b == c || a == b) cout << "TRIANGULO ISOSCELES" << endl;
}
return 0;
}