mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
17 lines
291 B
C++
17 lines
291 B
C++
|
#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;
|
||
|
}
|