1 条题解

  • 0
    @ 2025-8-12 14:58:02

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    long long a,b,s=0,ans=0;
    while(1){
    scanf("%lld%lld",&a,&b);
    ans=0;
    if(a==0&&b==0){
    break;
    }
    while(a!=0||b!=0){
    s+=a%10+b%10;
    if(s>=10){
    ans++;
    s=1;
    }else{
    s=0;
    }
    a/=10;
    b/=10;
    }
    s=0;
    cout<<ans<<endl;
    }
    return 0;
    }
    
    

    信息

    ID
    4433
    时间
    1000ms
    内存
    128MiB
    难度
    1
    标签
    递交数
    6
    已通过
    0
    上传者