1 条题解

  • 0
    @ 2025-10-18 14:46:16
    #include <bits/stdc++.h>
    using namespace std;
    long long m=0,x,h,a1,b1;
    string a,b,c,d,s;
    bool p;
    int main(){
        cin>>a;
        a1=a.length();
        for(int i=0;i<=a1-1;i++) x+=(a[i]-'0');
        while(x>=10)
        {
        	h=x;
        	x=0;
        	while(h!=0)
        	{
        		x+=h%10;
        		h=h/10;
    		}
        }
        cout<<x;
    }
    
    • 1

    信息

    ID
    397
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    (无)
    递交数
    62
    已通过
    30
    上传者