Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6075 | 翟** | 各个位数之和 | C++ | Accepted | 0 MS | 260 KB | 424 | 2025-01-03 21:29:28 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,g,s,b,q,w,a; cin>>n; g=n%10; s=n/10%10; b=n/100%10; q=n/1000%10; w=n/10000%10; a=g+s+b+q+w; cout<<a<<endl; return 0; }