Uva 12468 – Zapping

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

Solution :-

#include<stdio.h>
#include<stdlib.h>
int main()
{
 int a,b,i,c;
 while(scanf(“%d%d”,&a,&b)==2&& a>=0&&b>=0)
 {
     c=abs(a-b);
     if(c>=50)
     c=100-c;

   printf(“%dn”,c);
 }
 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