还是A+B
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10668 Accepted Submission(s): 5235
1 2 1 11 21 1 108 8 2 36 64 3 0 0 1
3 -1 -1 100#include<stdio.h>
int main()
{
int a,b,k,sum,x,y,i;
while(scanf("%d %d %d",&a,&b,&k),a||b)
{
sum=a+b;
for(i=k;i>0;i--)
{
x=a%10;
y=b%10;
if(x==y)
{
a=a/10;
b=b/10;
}
else break;
}
if(i>0) printf("%d\n",sum);
else printf("-1\n");
}
system("pause");
return 0;
}