Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
97557 蔡佳轩 各个位数之和 C++ Accepted 1 MS 272 KB 220 2024-11-16 10:54:52

Tests(5/5):


Code:

#include <iostream> using namespace std; int main(){ int a,sum=0; cin>>a; while(a!=0){ sum += a%10; //把末尾算出来 a = a/10; } cout<<sum; return 0; }