题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1229
解题报告:A+B
#include<cstdio> int main()
{
int a,b,k;
while(scanf("%d%d%d",&a,&b,&k) && !(a == b && a == ))
{
int sum = a + b;
while(a % == b % && k)
{
k--;
a /= ;
b /= ;
}
printf(k <= ? "-1\n":"%d\n",sum);
}
return ;
}