#include <stdio.h>
int main() {
int a, b;
while (scanf("%d%d",&a,&b) == 2){
if (!a && !b) return;
int c = 0, ans = 0;
for (int i = 9; i >= 0; i--) {
c = (a%10 + b%10 + c) > 9 ? 1 : 0;
ans += c;
a /= 10; b /= 10;
}
printf(“%d\n”, ans);
}
return 0;
}
//这个方法简直帅爆了
//c = (a%10 + b%10 + c) > 9 ? 1 : 0; 这个语句其实就是if语句的变形
//但是...我为什么就是不习惯用!!!!
//我会怎么写这个程序?
#include<stdio.h>
int main()
{
int a,b,times=0;
while(scanf("%d %d",&a,&b)==2)//哦对了,%D和%d输出的还不一样...
{
if(a==0&&b==0)
return 0;
else
{
int c=0;
for(int i=9;i>=0;i--)
{
if(a%10+b%10+c>9)
{
c=1;
times++;
}
a=a/10;b=b/10;
}
}
printf("%d\n",times);
}
}//一个大写加粗的冗长....
//有没有更好的办法?
//。。。暂时还没想出来。。。等我返回头再想
int main() {
int a, b;
while (scanf("%d%d",&a,&b) == 2){
if (!a && !b) return;
int c = 0, ans = 0;
for (int i = 9; i >= 0; i--) {
c = (a%10 + b%10 + c) > 9 ? 1 : 0;
ans += c;
a /= 10; b /= 10;
}
printf(“%d\n”, ans);
}
return 0;
}
//这个方法简直帅爆了
//c = (a%10 + b%10 + c) > 9 ? 1 : 0; 这个语句其实就是if语句的变形
//但是...我为什么就是不习惯用!!!!
//我会怎么写这个程序?
#include<stdio.h>
int main()
{
int a,b,times=0;
while(scanf("%d %d",&a,&b)==2)//哦对了,%D和%d输出的还不一样...
{
if(a==0&&b==0)
return 0;
else
{
int c=0;
for(int i=9;i>=0;i--)
{
if(a%10+b%10+c>9)
{
c=1;
times++;
}
a=a/10;b=b/10;
}
}
printf("%d\n",times);
}
}//一个大写加粗的冗长....
//有没有更好的办法?
//。。。暂时还没想出来。。。等我返回头再想