Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
134557 杨启宏 各个位数之和 C++ Wrong Answer 2 MS 272 KB 403 2025-10-28 19:01:11

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,m=1,o=10,s=0; cin>>n; do{ s+=n%o/m; m*=10; o*=10; }while(n%o/m!=0); cout<<s; return 0; }


Run Info:

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