Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
134559 左锶焜 各个位数之和 C++ Wrong Answer 2 MS 272 KB 396 2025-10-28 19:12:07

Tests(3/5):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,s=0; cin>>n; do{ s+=n%10; n/=10; }while(n%10!=0); cout<<s; return 0; }


Run Info:

------Input------
10111
------Answer-----
4
------Your output-----
3