Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
101840 谭思宸 各个位数之和 C++ Accepted 1 MS 272 KB 193 2024-12-20 13:30:06

Tests(5/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; }