OJ-Problems-Source/HDOJ/1229_autoAC.cpp

17 lines
291 B
C++
Raw Normal View History

2016-08-13 17:16:08 +08:00
#include <stdio.h>
int main()
{
int a,b,k;
while(scanf("%d%d%d",&a,&b,&k)!=EOF&&a&&b)
{
int m=1;
while(k--)
m*=10;
if(a%m==b%m)
printf("-1\n");
else
printf("%d\n",a+b);
}
return 0;
}