// C code for 9754. Egypt Problem code: SCPC11D
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
while(a&&b&&c)
{
if (a>b&&a>c&&b*b+c*c==a*a)
printf("right\n");
else if (b>c && b>a && c*c+a*a==b*b)
printf("right\n");
else if (a*a+b*b==c*c)
printf("right\n");
else
printf("wrong\n");
scanf("%d%d%d",&a,&b,&c);
}
return 0;
}
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
while(a&&b&&c)
{
if (a>b&&a>c&&b*b+c*c==a*a)
printf("right\n");
else if (b>c && b>a && c*c+a*a==b*b)
printf("right\n");
else if (a*a+b*b==c*c)
printf("right\n");
else
printf("wrong\n");
scanf("%d%d%d",&a,&b,&c);
}
return 0;
}
No comments:
Post a Comment