#45424: C++ if硬解


11210831@std.tcfsh.tc.edu.tw (陳韋溱臺中一中)

學校 : 不指定學校
編號 : 300872
來源 : [210.60.35.65]
最後登入時間 :
2025-06-23 11:20:34

#include<bits/stdc++.h>
using namespace std;

int main(){
int A, B , C;
cin >> A >> B >> C;
if(A>=B && A>=C && pow(B,2)+pow(C,2)>pow(A,2)){
cout << "acute triangle" <<endl;
}
else if(A>=B && A>=C && pow(B,2)+pow(C,2)==pow(A,2)){
cout << "right triangle" <<endl;
}
else if(A>=B && A>=C && pow(B,2)+pow(C,2)<pow(A,2)){
cout << "obtuse triangle" <<endl;
}
else if(B>=A && B>=C && pow(A,2)+pow(C,2)>pow(B,2)){
cout << "acute triangle" <<endl;
}
else if(B>=A && B>=C && pow(A,2)+pow(C,2)==pow(B,2)){
cout << "right triangle" <<endl;
}
else if(B>=A && B>=C && pow(A,2)+pow(C,2)<pow(B,2)){
cout << "obtuse triangle" <<endl;
}
else if(C>=B && C>=A && pow(B,2)+pow(A,2)>pow(C,2)){
cout << "acute triangle" <<endl;
}
else if(C>=B && C>=A && pow(B,2)+pow(A,2)==pow(C,2)){
cout << "right triangle" <<endl;
}
else{
cout << "obtuse triangle" <<endl;
}

return 0;
}