Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150240 卢语宸 各个位数之和 C++ Accepted 1 MS 272 KB 196 2026-03-23 22:18:02

Tests(5/5):


Code:

#include <iostream> using namespace std; int main() { int a,b=0,c,d; cin>>a; if(a<0) { a-=a; } c=a; while (c!=0) { d=c%10; b+=d; c=c/10; } cout<<b; return 0; }