1390H.cpp 231 B

12345678910111213
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. for (int n; cin >> n; ) {
  5. int s = 0;
  6. while (n) {
  7. s += n % 10;
  8. n /= 10;
  9. }
  10. cout << s << endl;
  11. }
  12. return 0;
  13. }