Uva 11854 – Egypt

Problem:-http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2954

Solution :-

#include<stdio.h>
int main()
{
long a,b,c,d,e,f;
while(scanf(“%ld %ld %ld”,&a,&b,&c)==3)
{
d=a*a;
e=b*b;
f=c*c;
if(a!=0 || b!=0 || c!=0)
 {
 if(f==d+e)
 printf(“rightn”);
 else if(d==e+f)
 printf(“rightn”);
 else if(e==d+f)
 printf(“rightn”);
 else
 printf(“wrongn”);
 }
}
return 0;
}
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .

Posted by Shipu Ahamed

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.