#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
int a,b,c;
cout << "輸入三邊長";
cin >>a>>b>>c;
if((a*a+b*b)==(c*c)){
cout<<a<<" "<<b<<" "<<c<<"\nRight\n";}
else if((a*a+b*b)<(c*c)){
cout<<a<<" "<<b<<" "<<c<<"\nObtuse\n";}
else if((a*a+b*b)>(c*c)){
cout<<a<<" "<<b<<" "<<c<<"\nAcute\n";}
else if((a*a+b*b)<=(c*c)){
cout<<a<<" "<<b<<" "<<c<<"\nNo\n";}
}
#include
#include
using namespace std;
int main(){
int a,b,c;
cout << "輸入三邊長";
cin >>a>>b>>c;
if((a*a+b*b)==(c*c)){
cout<<a<<" "<<b<<" "<<c<<"\nRight\n";}
else if((a*a+b*b)<(c*c)){
cout<<a<<" "<<b<<" "<<c<<"\nObtuse\n";}
else if((a*a+b*b)>(c*c)){
cout<<a<<" "<<b<<" "<<c<<"\nAcute\n";}
else if((a*a+b*b)<=(c*c)){
cout<<a<<" "<<b<<" "<<c<<"\nNo\n";}
}
輸入的邊長並沒有由小排到大
要自己排,然後再判斷
No 的條件是 ,且必須先判斷
此外, 不一定是由小到大的,所以要先排序
最後,不可輸出題目沒要求的內容:cout << "輸入三邊長";
No 的條件是 ,且必須先判斷
筆誤:條件是