LINK #
#include <stdio.h>
int main()
{
long long a,b,c,x,y,sum;
while(scanf("%lld %lld",&a,&b)==2){
if(a==0 && b==0)
break;
sum=0;
c=0;
while(1){
if(a==0&&b==0) break;
x=a%10;
y=b%10;
sum=sum+x+y;
if(sum>9){
sum=1;
c++;
}else{
sum=0;
}
a=a/10;
b=b/10;
}
if(c==0){
printf("No carry operation.\n");
}else if(c==1){
printf("%lld carry operation.\n",c);
}else{
printf("%lld carry operations.\n",c);
}
}
return 0;
}
#include <stdio.h>
int main()
{
long long a,b,c,x,y,sum;
while(scanf("%lld %lld",&a,&b)==2){
if(a==0 && b==0)
break;
sum=0;
c=0;
while(1){
if(a==0&&b==0) break;
x=a%10;
y=b%10;
sum=sum+x+y;
if(sum>9){
sum=1;
c++;
}else{
sum=0;
}
a=a/10;
b=b/10;
}
if(c==0){
printf("No carry operation.\n");
}else if(c==1){
printf("%lld carry operation.\n",c);
}else{
printf("%lld carry operations.\n",c);
}
}
return 0;
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন