3 solutions

  • 1
    @ 2026-9-16 19:02:21
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int m,n;
    	while(cin>>n>>m,n||m)
    	{
    		int s=0;
    		int k=0;
    		while(n&&m)
    		{
    			if(n%10+m%10+k>=10)
    			{
    				k=1;
    				s++;
    			}
    			else
    			{
    				k=0;
    			}
    			n/=10,m/=10;
    		}
    		cout<<s<<endl;
    	}
    	return 0; 
    }
    

    Information

    ID
    2846
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    3
    Tags
    # Submissions
    91
    Accepted
    33
    Uploaded By