題目連結: https://zerojudge.tw/ShowProblem?problemid=c294
# 解題思路
依照題目的意思做就好了~運用 swap () 函式將讓 c 值一定是最大值吧
# 程式碼
#include <iostream> | |
using namespace std; | |
int main() { | |
int a,b,c; | |
while(cin>>a>>b>>c){ | |
if(a>c) | |
swap(a,c); | |
if(b>c) | |
swap(b,c); | |
if(a>b) | |
swap(a,b); | |
cout<<a<<" "<<b<<" "<<c<<endl; | |
if(a+b<=c) | |
cout<<"No"; | |
else if(a*a+b*b>c*c) | |
cout<<"Acute"; | |
else if(a*a+b*b==c*c) | |
cout<<"Right"; | |
else | |
cout<<"Obtuse"; | |
cout<<endl; | |
} | |
return 0; | |
} |