我也覺得有問題
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
while (cin>>a>>b>>c)
{
if (a*a+b*b==c*c||b*b+c*c==a*a||c*c+a*a==b*b)
cout<<"right triangle"<<endl;
else if (a*a+b*b>c*c&&b*b+c*c>a*a&&c*c+a*a>b*b)
cout<<"acute triangle"<<endl;
else
cout<<"obtuse triangle"<<endl;
}
return 0;
}
這樣應該沒錯吧?
我也覺得有問題
#include
using namespace std;
int main()
{
int a,b,c;
while (cin>>a>>b>>c)
{
if (a*a+b*b==c*c||b*b+c*c==a*a||c*c+a*a==b*b)
cout<<"right triangle"<
else if (a*a+b*b>c*c&&b*b+c*c>a*a&&c*c+a*a>b*b)
cout<<"acute triangle"<
else
cout<<"obtuse triangle"<
}
return 0;
}
這樣應該沒錯吧?