Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
50561 | 逸凡 | 求和 | C++ | Accepted | 0 MS | 240 KB | 159 | 2024-08-30 18:45:18 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0; cin>>n; for(int i=n;i>0;i/=10){ sum+=i%10; } cout<<sum; return 0; }