#include <iostream>
#include <math.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
while (1)
{
int a, b, c;
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0)
{
break;
}
else if (sqrt((a * a + b * b)) == sqrt(c * c) ||
sqrt((a * a + c * c)) == sqrt(b * b) ||
sqrt((b * b + c * c)) == sqrt(a * a))
{
cout << "right" << "\n";
}
else if (sqrt((a * a + b * b)) != sqrt(c * c) ||
sqrt((a * a + c * c)) != sqrt(b * b) ||
sqrt((b * b + c * c)) != sqrt(a * a))
{
cout << "wrong" << "\n";
}
}
return 0;
}
코딩 테스트