檢驗三邊長是否形成直角三角形即可得解。
C++(0.000)
/*******************************************************/
/* UVa 11854 Egypt */
/* Author: Maplewing [at] knightzone.studio */
/* Version: 2016/03/17 */
/*******************************************************/
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int triangle[3];
while( scanf("%d%d%d", &triangle[0], &triangle[1], &triangle[2]) != EOF &&
triangle[0] != 0 && triangle[1] != 0 && triangle[2] != 0 ){
sort( triangle, triangle+3 );
if( triangle[0]*triangle[0] + triangle[1]*triangle[1] == triangle[2] * triangle[2] ){
printf("right\n");
}
else{
printf("wrong\n");
}
}
return 0;
}