AcWing 666. 三角形类型
原题链接
困难
作者:
逆佛
,
2021-04-25 22:06:45
,
所有人可见
,
阅读 252
确实调试起来小毛病不断,不可以a == b == c
#include <cstdio>
#include <cmath>
#include <iostream>
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);
//printf("值为%.1f %.1f %.1f", a, b, c);
if(a >= (b + c)) printf("NAO FORMA TRIANGULO\n");
else
{
if(a * a == b * b + c * c) printf("TRIANGULO RETANGULO\n");
if(a * a > b * b + c * c) printf("TRIANGULO OBTUSANGULO\n");
if(a * a < b * b + c * c) printf("TRIANGULO ACUTANGULO\n");
if((a == b) && (b == c)) printf("TRIANGULO EQUILATERO\n");
if((a == b) && (a != c) || (a == c) && (a != b) || (b == c) && (a != b)) printf("TRIANGULO ISOSCELES\n");
}
return 0;
}