Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
101835 王子毅 各个位数之和 C++ Accepted 1 MS 272 KB 202 2024-12-20 13:25:06

Tests(5/5):


Code:

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