竞赛
考级
LOVEKlee1314
#include <bits/stdc++.h> using namespace std; int main() { int n,sum=0; cin>>n; while(n) { sum+=n%10; n/=10; } cout<<sum; return 0; }
哒烧叶
准
#include <bits/stdc++.h> using namespace std; int main(){ int x,s=0; cin>>x; while(x!=0) { s+=x%10; x/=10; } cout<<s<<endl; return 0; }
Voldemort
共24条