Friday, February 18, 2011

11854 - Egypt


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

int main()
{
    register int arm[3];
    //freopen("in.txt","r",stdin);

    while(scanf("%d%d%d",&arm[0],&arm[1],&arm[2])&&(arm[0]||arm[1]||arm[2]))
    {
        sort(arm,arm+3);
        if((arm[2]*arm[2])^(arm[0]*arm[0]+arm[1]*arm[1]))
            printf("wrong\n");
        else
            printf("right\n");
    }
    return 0;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.