Click Here to go back to the homepage.

Egypt Solution:


#include <bits/stdc++.h>
using namespace std;

int main(){
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    int nums[3];
    while(cin >> nums[0] >> nums[1] >> nums[2]){
        if(nums[0] == 0){
            break;
        }
        sort(nums, nums + 3, greater<int>());
        if(nums[0] * nums[0] == nums[1] * nums[1] + nums[2] * nums[2]){
            cout << "right" << endl;
        } else {
            cout << "wrong" << endl;
        }
    }
    return 0;
}