Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
66084 石依灵 各个位数之和 C++ Wrong Answer 0 MS 272 KB 214 2024-03-02 13:42:45

Tests(0/5):


Code:

# include<iostream> using namespace std; int main(){ int n,s,c=1,x=0; cin>>n; s=n/10; while(s!=0){ s=s/10; x=x+n%10; c++; } cout<<x; return 0; }


Run Info:

------Input------
22222
------Answer-----
10
------Your output-----
8