#include <iostream>
using namespace std;
int main()
{
int x,y,z;
while(cin>>x>>y>>z)
{
if((x*x+y*y==z*z)||(x*x+z*z==y*y)||(y*y+z*z==x*x))
cout<<"right triangle"<<endl;
else if((x*x+y*y>z*z)&&(x*x+z*z>y*y)&&(y*y+z*z>x*x))
cout<<"acute triangle"<<endl;
else
cout<<"obtuse triangle"<<endl;
}
return 0;
}
#include
using namespace std;
int main()
{
int x,y,z;
while(cin>>x>>y>>z)
{
if((x*x+y*y==z*z)||(x*x+z*z==y*y)||(y*y+z*z==x*x))
cout<<"right triangle"<
else if((x*x+y*y>z*z)&&(x*x+z*z>y*y)&&(y*y+z*z>x*x))
cout<<"acute triangle"<
else
cout<<"obtuse triangle"<
}
return 0;
}
建議你先排序三邊大小
因為你都是錯在把 acute triangle 判斷成 obtuse triangle