#include <cstdio>
int main(){
int a, b;
while (scanf_s("%d%d", &a, &b) == 2){
if (a == 0 || b == 0){
return 0;
}
int c = 0;
int n = 0;
while (a != 0 || b != 0){
c = (a % 10 + b % 10 + c) / 10;
if (c > 0){
++n;
}
a /= 10;
b /= 10;
}
printf("n=%d\n", n);
}
return 0;
}
算法竞赛入门经典 5.2.1有多少位进位
最新推荐文章于 2023-04-05 00:33:27 发布