#12566: C++簡易參考解答


shawn2000100 (東華財金)


#include <iostream>
#include <algorithm>
using namespace std;

int main() {
int A[3];

while ( cin >> A[0] >> A[1] >> A[2] ) {
sort ( A, A + 3 );

if ( A[0] * A[0] + A[1] * A[1] == A[2] * A[2] )
cout << "right triangle" << endl;
else if ( A[0] * A[0] + A[1] * A[1] < A[2] * A[2] )
cout << "obtuse triangle" << endl;
else
cout << "acute triangle" << endl;
}

return 0;
}