Posted by: dzikrina on: October 29, 2010
//checking phytagoras rectangle
#include
#include
#include
using namespace std;
int main()
{
int input[3];
int sum, C;
while (cin >> input[0] >> input[1] >> input[2])
{
if ( (input[0]== 0) && (input[1] == 0) && (input[2]== 0))
break;
sort( input, input+3 );
sum = ( (input[0]*input[0])+(input[1]*input[1]));
C = (input[2]*input[2]);
if ( sum == C)
cout << "right" << endl;
else
cout << "wrong" << endl;
}
return 0;
}
Recent Comments