Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
101838 谭思宸 各个位数之和 C++ Presentation Error 1 MS 272 KB 198 2024-12-20 13:29:32

Tests(0/5):


Code:

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