#include<bits/stdc++.h> using namespace std; int main() { int N,s; s=0; cin>>N; while(N) { s+=N%10; N/=10; } cout<<s; return 0; } /************************************************************** Problem: 1119 User: LYY001 Language: C++ Result: Accepted Time:7 ms Memory:2072 kb ****************************************************************/