int main()
{
int a,b,i,j,r,r1,c,s,t;
while(scanf("%d %d",&a,&b)!=EOF)
{
c=0;
t=0;
if(a==0 && b==0)
{
break;
}
while(1)
{
if(a==0 && b==0)
{
break;
}
r=a%10;
r1=b%10;
if(t==1)
{
s=r+r1+1;
}
else
{
s=r+r1;
}
if(s>9)
{
c++;
t=1;
}
else
{
t=0;
}
a=a/10;
b=b/10;
}
if(c==0)
{
printf("No carry operation.\n");
}
else if(c==1)
{
printf("%d carry operation.\n",c);
}
else
{
printf("%d carry operations.\n",c);
}
}
return 0;
}
0 comments:
Post a Comment