Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118365 冯瀚翔 各个位数之和 C++ Accepted 1 MS 272 KB 212 2025-04-28 18:42:59

Tests(5/5):


Code:

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