1470G.py 118 B

12345678
  1. while True:
  2. n = int(input().strip())
  3. s = 0
  4. while n > 0:
  5. s += n % 10
  6. n //= 10
  7. print(s)