int main() { string s="316"; int n=s.length(); int x=0; for(int i = 0; i < n; i++) x += s[i]; cout << x << endl; return 0; }
10
58
154
316