문제출처 : https://www.acmicpc.net/problem/4153
code
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int x, y, z, maxvalue, temp;
while (true)
{
cin >> x >> y >> z;
if (x == 0 && y == 0 && z == 0)
break;
maxvalue = max(x, y);
maxvalue = max(maxvalue, z);
if (x == maxvalue)
{
temp = pow(maxvalue, 2);
if (temp == pow(y, 2) + pow(z, 2))
cout << "right" << '\n';
else
cout << "wrong"<<'\n';
}
else if (y == maxvalue)
{
temp = pow(maxvalue, 2);
if (temp == pow(x, 2) + pow(z, 2))
cout << "right" << '\n';
else
cout << "wrong"<<'\n';
}
else
{
temp = pow(maxvalue, 2);
if (temp == pow(x, 2) + pow(y, 2))
cout << "right" << '\n';
else
cout << "wrong"<<'\n';
}
}
return 0;
}