题目地址:http://ac.jobdu.com/problem.php?cid=1041&pid=2
C语言源码:
#include<stdio.h>
int main()
{
int a,b,numa,numb;
scanf("%d %d",&a,&b);
while(a||b)
{
b=a-b;
numa=0;
while(a)
{
a=a/2;
numa+=a;
}
numb=0;
while(b)
{
b=b/2;
numb+=b;
}
printf("%d\n",numa-numb);
scanf("%d %d",&a,&b);
}
}