Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
12253 | 徐一喆 | 【入门】求任意三位数各个数位上数字的和 | C++ | Accepted | 2 MS | 728 KB | 193 | 2021-05-20 13:06:43 |
#include<bits/stdc++.h> using namespace std; int main() { int a,sum=0; cin>>a; while(a) { sum+=a%10; a/=10; } cout<<sum<<endl; return 0; }