Problem:


Sum of Numbers

  Write a program which reads an integer and prints sum of its digits.

Input

  The input consists of multiple datasets. For each dataset, an integer x is given in a line. The number of digits in x does not exceed 1000.

The input ends with a line including single zero. Your program should not process for this terminal symbol.

Output

  For each dataset, print the sum of digits in x.

Sample Input

123
55
1000
0

Sample Output

6
10
1



Sample input:
123
55
1000
0


Sample output:
6
10
1

Submission status: Accepted

Solution code:
while True:
    letters = input()
    if letters == '0':
        break
    sumed = 0
    for letter in letters:
        sumed += int(letter)
    print(sumed)

Submission status: Accepted

Solution code:
while True:
    a = raw_input()
    if a == '0':
        break
    print sum(map(int,a))

Submission status: Accepted

Solution code:
while(True):
    s = str(input())
    if(s == '0'): break
    ans = 0
    for i in range(len(s)):
        ans += int(s[i])
    print(ans)

Submission status: Accepted

Solution code:
while 1:
	x = raw_input()
	if x == '0':
		break
	s = 0
	for i in xrange(len(x)):
		s += int(x[i])
	print s

Submission status: Accepted

Solution code:
while(True):
    x = input()
    if x == '0':
        break

    print(sum(list(map(int, x))))

Submission status: Accepted

Solution code:
#   ?????????????????°???????????????????¨??????????????????°??????
while 1:
    #   ?¨??????\???????????°???????????????
    input_num = list(input())
    #   ???????????????"0"??\?????§??????
    if int(input_num[0]) == 0:
        break
    #   print(input_num)
    #   ??????????¨?????????????????????°
    digitTotal = 0
    for i in range(0, len(input_num)):
        digitTotal += int(input_num[i])
    print("{0}".format(digitTotal))

Submission status: Accepted

Solution code:
# 16-Character-Sum_of_Numbers.py

# ??°?????????
# ?????????????????°???????????????????¨??????????????????°?????????????????????????????????

# Input
# ?????°??????????????????????????\?????¨??????????????????????????????????????????????????????????????´??° x ?????????????????§?????????????????????
# x ??? 1000 ?????\????????´??°??§??????
# x ??? 0 ?????¨?????\?????????????????¨??????????????????????????????????????????????????????????????£????????????????????????
# Output
# ????????????????????????????????????x ???????????????????????????????????????????????????

# Sample Input
# 123
# 55
# 1000
# 0
# Sample Output
# 6
# 10
# 1

data=[]

while 1:
	temp = int( input() )
	if temp==0:
		break;
	else:
		data.append( temp )

for i in range( len(data) ):
	num = list( map(int, list( str( data[i] ) ) ) )
	print( sum(num) )

Submission status: Accepted

Solution code:
x = input()

while x !='0':
    x_list = list(x)
    #print(x_list)
    #print("{0}".format(len(x_list)))
    sum = 0
    for i in range(len(x_list)):
        sum += int(x_list[i])
    print(sum)    
    x = input()

Submission status: Accepted

Solution code:
while 1:
    str = input()
    if(str == '0'): break
    print(sum([int(c) for c in list(str)]))

Submission status: Accepted

Solution code:
x = input()

while x != '0':
    x_list = list(x)
    # print(x_list)
    # print("{0}".format(len(x_list)))
    sum = 0
    for i in range(len(x_list)):
        sum += int(x_list[i])
    print(sum)
    x = input()

Submission status: Accepted

Solution code:
#   ?????????????????°???????????????????¨??????????????????°??????
while 1:
    #   ?¨??????\???????????°???????????????
    input_num = list(input())
    #   ???????????????"0"??\?????§??????
    if int(input_num[0]) == 0:
        break
    #   print(input_num)
    #   ??????????¨?????????????????????°
    digit_total = 0
    for i in range(0, len(input_num)):
        digit_total += int(input_num[i])
    print("{0}".format(digit_total))

Submission status: Accepted

Solution code:
while True:
    x = list(input())
    if x[0] == "0":
        break
    sum = 0
    for i in range(len(x)):
        sum += int(x[i])
    print(sum)
    #print(x)

Submission status: Accepted

Solution code:
while True:
    x = input()
    if x == '0': break
    print(sum(list(map(int,list(x)))))

Submission status: Accepted

Solution code:
import sys
import math

while 1:
    n = input()

    if (n == 0):
        break

    ret = 0

    while n > 0:
        ret += n % 10
        n /= 10

    print ret

Submission status: Accepted

Solution code:
while 1:
	x=raw_input()
	if x=='0':
		break
	print sum(map(int,x))

Submission status: Accepted

Solution code:
while True:
	num = list(map(int,*input().split()))
	if num == [0]:
		break
	print(sum(num))

Submission status: Accepted

Solution code:
while True:
	ipt=raw_input()
	if ipt=="0":
		break
	k=0
	for i in ipt:
		k+=int(i)
	print k

Submission status: Accepted

Solution code:
while True:
    integer = input()
    if int(integer) == 0:
        break
    print(sum(list(map(int, list(integer)))))

Submission status: Accepted

Solution code:
while True:
    s = input()
    if int(s) == 0:
        break;
    ans = 0
    for i in s:
        ans += int(i)
    print(ans)

Submission status: Accepted

Solution code:
while True:
	num_str = input()
	if num_str == "0":
		break;

	sum = 0
	for num in list(num_str):
		sum += int(num)
	print(sum)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0:
        break
    r = 0
    while n != 0:
        r += n%10
        n //= 10
    print(r)

Submission status: Accepted

Solution code:
x = int(input())
while x:
    s = 0
    while x:
        s += x%10
        x//=10
    print (s)
    x = int(input())

Submission status: Accepted

Solution code:
while True:
	num = input()
	if num == '0':
		break
	cnt = 0
	for i in num:
		cnt += int(i)
	print(cnt)

Submission status: Accepted

Solution code:
while True:
    data = input()
    if data == '0':
        break

    print(sum([int(i) for i in data]))

Submission status: Accepted

Solution code:
while True:
    data = input()
    if data[0] == '0':
        break
        
    print(sum([int(i) for i in data]))

Submission status: Accepted

Solution code:
while True:
    data = input()
    if data[0] == '0':
        break

    print(sum([int(i) for i in data]))

Submission status: Accepted

Solution code:
while True:
    data = int(input())
    if data == 0:
        break

    sum = 0
    while data > 0:
        sum += data % 10
        data //= 10
    print(sum)

Submission status: Accepted

Solution code:
while True:
    data = input()
    if data == '0':
        break
 
    print(sum([int(i) for i in data]))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
#coding: UTF-8
import sys

a = sys.stdin.readlines()

for j in a:
	b = []
	for i in j.rstrip('\n'):
		b.append(int(i))
	if sum(b) == 0:
		break
	else:
		print sum(b)

Submission status: Accepted

Solution code:
while True:
    data=input()

    if data[0]=='0':
        break
    print(sum([int(i)for i in data]))

Submission status: Accepted

Solution code:
while True:
    data = input()
    if data[0] == '0':
        break
 
    print(sum([int(i) for i in data]))

Submission status: Accepted

Solution code:
while True:
    s = input()
    if int(s) == 0:
        break
    g  = 0
    for c in s:
        g += int(c)
    print(g)

Submission status: Accepted

Solution code:
while True:
    data = input()

    if data[0] == '0':
        break
    print(sum([int(i) for i in data]))

Submission status: Accepted

Solution code:
while True:
    N=input()
    if N=="0":
        break
    else:
        print(sum([int(x) for x in list(N)]))

Submission status: Accepted

Solution code:
while True:
    n = input()
    if n == '0':
        break
    print(sum([int(x) for x in list(n)]))

Submission status: Accepted

Solution code:
while True:
    n = input()
    if n == '0':
        break
    print(sum([int(x) for x in n]))

Submission status: Accepted

Solution code:
while True:
    x = input()
    if x == '0':
        break
    print(sum(int(c) for c in x))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
while True:
 s = raw_input()
 if s=="0": break
 t = 0
 for n in s:
  t += int(n)
 print t

Submission status: Accepted

Solution code:
while True:
 s = raw_input()
 if s!="0": print sum(map(int, s))
 else: break

Submission status: Accepted

Solution code:
num = int(input())
while num != 0:
    sum = 0
    k = 1
    while num>=k:
        sum = sum + num%(k*10)//k
        k = k*10
    print(sum)
    num = int(input())

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == '0':
        break
    sum = 0
    for d in s:
        sum += int(d)
    print(sum)

Submission status: Accepted

Solution code:
sum = 0
while(1):
    num = raw_input()
    if num == '0':
        break
    else:
        for i in range(len(num)):
            sum += int(num[i])
    print sum
    sum = 0

Submission status: Accepted

Solution code:
while True:
    n = []
    n = list(map(int, input()))
    if n == [0]:
        break
    print(sum(n))

Submission status: Accepted

Solution code:
while 1:
    input = raw_input()
    num = len(input)
    input = int(input)
    
    if input == 0:
        break
        
    count = 0
    for i in range(num, 0, -1):
        value = int(input / 10**(i-1))
        input -= value * 10 ** (i-1)
        count += value

    print(count)

Submission status: Accepted

Solution code:
while 1:
 n = input()
 if int(n) == 0:
  break
 sum = 0
 for i in range(len(n)):
  sum += int(n[i])
 print(sum)

Submission status: Accepted

Solution code:
while True:
    number = input()
    if number == "0":
        break
    else:
        number2 = []
        for i in range(len(number)):
            number2.append(number[i])

        number2 = map(int, number2)
        answer = sum(number2)

        print(answer)

Submission status: Accepted

Solution code:
while True:
    n = raw_input()
    if n == '0':
        break
    num = map(int,list(n))
    j= 0
    for i in num:
	j += i
    print j

Submission status: Accepted

Solution code:
while True:
    x = input()
    if x.rstrip() == "0":
        break
    else:
        s = 0
        for c in x:
            s += int(c)
        print(s)

Submission status: Accepted

Solution code:
while True:
    x = input()
    if x == '0':
        break
    print(sum(int(c) for c in str(x)))

Submission status: Accepted

Solution code:
while True:
    number = input()
    if(number == "0"): 
        break
    print(sum([int(a) for a in list(number)]))

Submission status: Accepted

Solution code:
while True:
    line = list(map(int, input()))
    if line==[0]: break
    print(sum(line))

Submission status: Accepted

Solution code:
while True:
    n = input()
    if n == '0':
        break
    sum = 0
    for i in n:
        sum += int(i)
    print(sum)

Submission status: Accepted

Solution code:
while True:
    value = [int(x) for x in raw_input()]
    if value[0] == 0:
        break
    print(sum(value))

Submission status: Accepted

Solution code:
while True:
    s = input()
    if len(s) == 1 and s[0] == '0': break
    total = 0
    for i in range(0,len(s)):
        total += int(s[i])
    print("%d" % total)

Submission status: Accepted

Solution code:
while True:
    x = input()
    if int(x) == 0: break
    print(sum([int(i) for i in x]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_B

??°?????????

?????????????????°???????????????????¨??????????????????°?????????????????????????????????
"""

if __name__ == '__main__':
    while True:
        # ??°?????????????????\???(??????????????????)
        raw_input = input()

        if raw_input == '0':
            break

        # ???????????°??????????¨??????????????????????
        total = sum(map(int, raw_input))
        print(total)

Submission status: Accepted

Solution code:
while True:
  x = input()
  if x == '0':
    quit()

  print(sum([int(_) for _ in x]))

Submission status: Accepted

Solution code:
values = []
while True:
    val = int(input())
    if 0 == val:
        break
    values.append(val)

for val in values:
    sum = 0
    while val >= 1:
        sum += (val % 10)
        val //= 10
    print(sum)

Submission status: Accepted

Solution code:
while True:
    s=input()
    if s=="0":
        break
    print(sum([int(i) for i in s]))

Submission status: Accepted

Solution code:
while True:
    s=input()
    if s == '0':
        break
    print(str(sum(map(int, s))))

Submission status: Accepted

Solution code:
while(1):
	a=int(input())
	if a==0:
		break 
	a=list(map(int,list(str(a))))
	print(sum(a))

Submission status: Accepted

Solution code:
N=[]
while True:
    n=raw_input()
    if n=='0':
        break
    N.append(n)
for i in range(len(N)):
    print('%d'%sum(map(int,N[i])))

Submission status: Accepted

Solution code:
while True:
    a = input()
    if a == "0":
        break
    a = [int(i) for i in a]
    print(sum(a))

Submission status: Accepted

Solution code:
while True:
    n = input()
    if n == "0":
        break
    print(sum([int(i) for i in n]))

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s=="0":
        break
    print(sum(map(int,s)))

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == '0':
        break
    print(sum(list(map(int, list(s)))))

Submission status: Accepted

Solution code:
n = input()
while n != "0":
    ans = 0
    for i in range(len(n)):
        ans += ord(n[i:i+1]) - 48

    print(ans)
    n = input()

Submission status: Accepted

Solution code:
#coding:utf-8
while True:
	l = [int(x) for x in input()]
	if len(l) and l[0]==0:
		break
	print(sum(l))

Submission status: Accepted

Solution code:
while True:
    a = input()
    if a == '0':
        break
    print(sum(map(int,*a.split())))

Submission status: Accepted

Solution code:
while(True):
    s = input()
    if s == '0': exit()
    print(sum([int(c) for c in s]))

Submission status: Accepted

Solution code:
array = []
while True:
    n = int(input())
    if n != 0:
        array.append(n)
    else:
        break
for i in range(len(array)):
    data = str(array[i])
    s = 0
    for c in data:
        s += int(c)
    print(s)

Submission status: Accepted

Solution code:
while 1:
    n=input()
    if n=='0':break
    print(sum(int(x) for x in n))

Submission status: Accepted

Solution code:
'''
ITP-1_8-B
 ??°?????????
?????????????????°???????????????????¨??????????????????°?????????????????????????????????
???Input
?????°??????????????????????????\?????¨??????????????????????????????????????????????????????????????´??° x ?????????????????§?????????????????????
x ??? 1000 ?????\????????´??°??§??????
x ??? 0 ?????¨?????\?????????????????¨??????????????????????????????????????????????????????????????£????????????????????????
???Output
????????????????????????????????????x ???????????????????????????????????????????????????
'''
while True:
    # inputData
    inputData = input()
    if inputData == '0':
        break

    # outputData
    outputData = 0
    for cnt0 in inputData:
        outputData += int(cnt0)
    print(outputData)

Submission status: Accepted

Solution code:
import sys

for i in sys.stdin:
    i = int(i)
    if i == 0:
        break
    (a,b) = divmod(i, 10)
    sum = b
    while a != 0:
        (a,b) = divmod(a,10)
        sum += b
    print(sum)

Submission status: Accepted

Solution code:
while 1:
    x = input()
    if x[0] == "0":
        break
    print (sum(int(i)for i in x))

Submission status: Accepted

Solution code:
import sys

def sum_of_digits(x):
	sum = 0
	while x > 0:
		sum += x % 10
		x = x // 10

	return sum

#fin = open("test.txt", "r")
fin = sys.stdin

while True:
	x = int(fin.readline())

	if x == 0:
		break

	print(sum_of_digits(x))

Submission status: Accepted

Solution code:
#!usr/bin/env python3


def main():
    while True:
        numbers = input()
        if int(numbers) == 0:
            break
        res = 0
        for i in numbers:
            res += int(i)
        print(res)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

while True:
	x = int(input())
	if x == 0:
		break
		
	S = 0
	while True:
		if x < 10:
			S += x
			break
		else:
			r = x % 10
			S += r
			x //= 10
			
	print(S)

Submission status: Accepted

Solution code:
while True:
    a = input()
    if a == "0":
        break
    else:
        b = list(a)
        c = [int(b[i]) for i in range(len(b))]
        print(sum(c))

Submission status: Accepted

Solution code:
while 1:
    I = raw_input()
    if I == '0':
        break
    print sum(map(int,I))

Submission status: Accepted

Solution code:
while 1:
    b=0
    a = [int(i) for i in input()]
    if a[0] == 0:
        break
    for i in range(len(a)):
        b += a[i]
    print(b)

Submission status: Accepted

Solution code:
while(1):
    word = input()
    if (word == "0"):
        break
    result = 0
    for i in word:
        result += int(i)
    print(result)

Submission status: Accepted

Solution code:
while True:
    inp = input()
    if inp == "0": break
    s = 0
    print(sum(list(map(int,list(inp)))))

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == '0':
        break

    print(sum([int(x) for x in s]))

Submission status: Accepted

Solution code:
res = []
while True:
    s = input()
    if s == '0':
        break

    res.append(sum([int(x) for x in s]))

for e in res:
    print(e)

Submission status: Accepted

Solution code:
while(True):
    n = input()
    if n == "0": break
    print(sum(map(int, n)))

Submission status: Accepted

Solution code:
while(1):
	char_list = list(input())
	int_list = [0 for i in range(len(char_list))]

	if char_list[0] == '0':
		break
	for i in range(len(char_list)):
		int_list[i] = int(char_list[i])
	print(sum(int_list))

Submission status: Accepted

Solution code:
data = []
while True:
    x = input().strip()
    if x == '0':
        break
    data.append(list(map(int, list(x))))

for i in range(len(data)):
    print(sum(data[i]))

Submission status: Accepted

Solution code:
array = []
suum = 0
while True:
    n = int(input())
    if n == 0:
        break
    array.append(n)
for i in range(len(array)):
    for i2 in range(len(str(array[i]))):
        suum += int(str(array[i])[i2])
    print(suum)
    suum = 0

Submission status: Accepted

Solution code:
while True :
    tem = input()
    res = 0
    if tem == '0' : break
    for i in tem : res += int(i)
    print(res)

Submission status: Accepted

Solution code:
while 1:
  x=raw_input()
  if x=='0':break
  sum=0
  for i in x:
    sum+=int(i)
  print sum

Submission status: Accepted

Solution code:
a = raw_input()
while a!='0':
	s = 0
	for i in range(len(a)):
		s += int(a[i])

	print s
	a = raw_input()

Submission status: Accepted

Solution code:
while True:
    number = input()
    if number == '0':
        break
    print(sum(list(map(int,number))))

Submission status: Accepted

Solution code:
while True:
    x = input()
    if x=='0':
        break
    print(sum([int(x[i]) for i in range(len(x))]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os


for s in sys.stdin:
    s = s.strip()
    if s == '0':
        break
    else:
        v = 0
        for c in s:
            v += int(c)
        print(v)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0: break
    nsum = 0
    while n != 0:
        nsum += n%10
        n = n//10
    print(nsum)

Submission status: Accepted

Solution code:
parent_list = []
while True:
    parent_list.append(input())
    if parent_list[-1] == '0':
        break

for n in parent_list[:-1]:
    sum = 0
    for c in n:
        sum += int(c)
    print(sum)

Submission status: Accepted

Solution code:
while 1:
    num = input()
    if num == "0":
        break

    a = []
    for i in range(len(num)):
        a.append(int(num[i:i+1]))
    print(sum(a))

Submission status: Accepted

Solution code:
x = 1
while x != '0':
	x = input()
	if x != '0':
		sum = 0
		for s in x:
			sum += int(s)
		print(sum)

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
 
def func():
    inputdata=[]
    while(True):
        try:
            line=input().rstrip()
            if(int(line)==0):
                break
            else:
                inputdata.append(line)
        except EOFError:
            return 0
        except:
            return inputError()
    
    data=[sum( [int(char) for char in item] ) for item in inputdata]
    [print(item) for item in data]
        
def inputError():
    print("input Error")
    return -1
 
func()

Submission status: Accepted

Solution code:
#!/usr/bin/env python

numbers = []
sumN = []
while True:
    number = input()
    if number == '0':
        break
    numbers.append(number)
    
for x in numbers:
    value = 0
    for y in x:
        value += int(y)
    sumN.append(value)

for x in sumN:
    print(x)

Submission status: Accepted

Solution code:
while True:
    x = input()
    if x == "0":
        break
    num = [int(i) for i in x]
    print(sum(num))

Submission status: Accepted

Solution code:
while True:
    x = input()
    if x == 0:
        break

    total = 0
    while x != 0:
        total += x % 10
        x = x//10

    print(total)

Submission status: Accepted

Solution code:
while True:
    n = input()
    if n == "0":
        break
    ans = sum([int(x) for x in n])
    print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

for l in stdin:
    l = l.rstrip()
    if 0 == int(l):
        break

    print(sum([int(ch) for ch in l]))

Submission status: Accepted

Solution code:
N = input()
while N != "0":
 SUM = 0
 for i in N:
  SUM += int(i)
 print(SUM)
 N = input()

Submission status: Accepted

Solution code:
while 1:
    x = input()
    if x == "0":
        break
    kei = 0
    for i in x:
        kei += int(i)
    print(kei)

Submission status: Accepted

Solution code:
str = input()
while int(str[0]):
    sum = 0
    for char in str:
        sum += int(char)
    print(sum)
    str = input()

Submission status: Accepted

Solution code:
#coding:utf-8
x=""
while x != "0":
    x = input().rstrip()

    if x =="0":
        break
    
    y = sum(list(map(int , list(x))))
    print(y)

Submission status: Accepted

Solution code:
while 1:
    s = input()
    if s == '0':break
    print(sum(int(n) for n in s))

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == "0":
        break
    nums = list(s)
    goukei = 0
    for i in range(len(nums)):
        goukei += int(nums[i])
    print(goukei)

Submission status: Accepted

Solution code:
while True:
    num = raw_input()
    if num == "0":
        break
    output = 0
    for i in num:
        output += int(i)
    print output

Submission status: Accepted

Solution code:
while True:
    l=list(input())
    if l==["0"]:
        break
    print(sum(map(int,l)))

Submission status: Accepted

Solution code:
while True:
    x = input()
    if x == "0":
        break
    sum_x = 0
    for X in x:
        sum_x += int(X)
    print(sum_x)

Submission status: Accepted

Solution code:
x=1
while True:
    x=list(input())
    x=map(int,x)
    x=sum(x)
    if x==0:
        break
    print(x)

Submission status: Accepted

Solution code:
while True:
    n = sum(map(int, input()))
    if n == 0:
        break
    print(n)

Submission status: Accepted

Solution code:
while True:
    data = input()
    if data == '0':
        break
    sum = 0
    for c in data:
        sum += int(c)
    print(sum)

Submission status: Accepted

Solution code:
while 1:
    x=[int(i) for i in input()]
    if sum(x)==0:
        break
    print(sum(x))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
????????????
"""
while True:
    cnt = 0
    inp = input().strip()
    if int(inp[0]) == 0:
        break
    for i in range(len(inp)):
        cnt += int(inp[i])
    print(cnt)

Submission status: Accepted

Solution code:
while True:
	data = input()
	if data == '0':
		break
	else:
		data = [int(s) for s in data]
		print(sum(data))

Submission status: Accepted

Solution code:
while True:
	s = input()
	if s == '0':
		break
	print(sum([int(c) for c in s]))

Submission status: Accepted

Solution code:
def main():
    N = []
    while True:
        x = input()
        if x == '0':
            break
        else:
            N.append(x)

    for n in N:
        ans = sum(map(int, list(n)))
        print(ans)

main()

Submission status: Accepted

Solution code:
x = 1
L=[]
n= 0
s=0
while x is not 0:
    x = int(input())
    L.append(x)
N=1
L.remove(0)
for i in L:
    while i >=N:

        N=10*N
        n =i%N
        s+=(n/N*10)
        i-=n
    print (int(s))
    s=0
    N = 1

Submission status: Accepted

Solution code:
while True:
    s=input()
    if s=="0":
        break
        
    n=list(map(int, list(s)))
    print(sum(n))

Submission status: Accepted

Solution code:
while True:
  x = sum(map(int, input()))

  if x == 0:
    break

  print(x)

Submission status: Accepted

Solution code:
while True:
  x=input()
  if x == '0':
   break
  print(sum(int(z) for z in x))

Submission status: Accepted

Solution code:
while True:
	a = input()
	if a == "0":
		break
	print(sum([int(a[i]) for i in range(len(a))]))

Submission status: Accepted

Solution code:
list1 = []
while True:
    x = str(input())
    if x == '0':
        break
    else:
        result=0
        for i in x:
            result += int(i)
        list1.append(result)
            
for i in list1:
    print(i)

Submission status: Accepted

Solution code:
while True:
    string = input()
    if string == "0":break
    print(sum(int(x) for x in string))

Submission status: Accepted

Solution code:
while True:
    num = input()
    if num == "0":
        break
    print(sum(map(int, list(num))))

Submission status: Accepted

Solution code:
while True:
    n = input()
    if int(n) == 0:
        break
    else:
        sum = 0
        for i in range(len(n)):
            sum += int(n[i])

        print(sum)

Submission status: Accepted

Solution code:
a=0

while True:
    z=str(input())
    if z == '0' :
        break
    for i in z:
        k=int(i)
        a+=k
    print(a)
    a=0

Submission status: Accepted

Solution code:
while True:
    x = input()
    if int(x) == 0:break
    ret = 0
    for a in x:
        ret += int(a)
    print(ret)

Submission status: Accepted

Solution code:
x = input()
while 1:
    sum_x = 0
    if x == "0":
        break
    for c in x:
        sum_x += int(c)
    print(sum_x)
    x = input()

Submission status: Accepted

Solution code:
xin = []
while True:
    x = int(raw_input())
    if x == 0:
        break
    xin += [x]
for i in xin:
    print sum(map(int , list(str(i))))

Submission status: Accepted

Solution code:
xin = []
while True:
    x = raw_input()
    if x == '0':
        break
    xin += [x]
for i in xin:
    print sum(map(int , list(i)))

Submission status: Accepted

Solution code:
xin = []
while True:
    x = raw_input()
    if x == '0':
        break
    #xin += [x]
    print sum(map(int , list(x)))
#for i in xin:
    #print sum(map(int , list(i)))

Submission status: Accepted

Solution code:
while True:
    x = raw_input()
    if x == '0':
        break
    print sum(map(int , list(x)))

Submission status: Accepted

Solution code:
while(1):
	num = list(map(int,input()))
	
	if num[0] == 0:
		break
	print(sum(num[:]))

Submission status: Accepted

Solution code:
# Aizu Problem ITP_1_8_B: Sum of Numbers
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def digit_sum(n):
    s = 0
    while n > 0:
        s += n % 10
        n //= 10
    return s


while True:
    n = int(input())
    if n == 0:
        break
    print(digit_sum(n))

Submission status: Accepted

Solution code:
while True:
    z=list(map(int,(list(str(input())))))
    if z[0]==0:
        break
    print(sum(z))

Submission status: Accepted

Solution code:
while True:
    i = list(map(int,list(input())))
    if i == [0]:
        break
    else:
        print(sum(i))

Submission status: Accepted

Solution code:
while True:
    x = input()
    if x == "0":
        break
    sum_s = 0
    for s in x:
        sum_s += int(s)
    print(sum_s)

Submission status: Accepted

Solution code:
while True:
   x=input()
   if x=="0":
       break
   cnt = 0
   for i in x:
       num = int(i)
       cnt += num
   print(cnt)

Submission status: Accepted

Solution code:
while(True):
    a = input()
    if(a == '0'):
        break
    b = [int(i) for i in list(str(a))]
    print(sum(b))

Submission status: Accepted

Solution code:
n = input()

while n != "0":
	sum = 0
	for i in n:
		sum += int(i)
	print(sum)
	n = input()

Submission status: Accepted

Solution code:
Nsum = 0

while True:
    I = input()
    if int(I) == 0:
        break
    for i in I:
        Nsum += int(i)
    print(Nsum)
    Nsum = 0

Submission status: Accepted

Solution code:
# coding: utf-8

while True:
    strnum = input().rstrip()
    if strnum == "0":
        break
    answer = sum(map(int, strnum))
    print(answer)

Submission status: Accepted

Solution code:
x = str(input())
while x != "0":
    ans = 0
    for i in list(x):
        ans += int(i)
    print(ans)
    x = str(input())

Submission status: Accepted

Solution code:
while True:
    numbers = [int(i) for i in  list(input())]
    if len(numbers) == 1 and numbers[0] == 0:
        break
    print(sum(numbers))

Submission status: Accepted

Solution code:
def f(s):
    return sum(map(int, s))

while True:
    s = input()
    if s == "0":
        break

    print(f(s))

Submission status: Accepted

Solution code:
while True:
    n=sum(list(map(int, list(input()))))
    if n == 0:
        break
    print(n)

Submission status: Accepted

Solution code:
sum_list=[]
while True:
    num=input()
    if num=='0':
        break
    num_list=list(num)
    for i in range(0,len(num_list)):
        num_list[i]=int(num_list[i])
    sum_list.append(sum(num_list))

for i in sum_list:
    print(i)

Submission status: Accepted

Solution code:
while True:
    x = int(input())
    if x == 0:
        break
    sum = 0
    while x != 0:
        sum += x%10
        x = x//10

    print(sum)

Submission status: Accepted

Solution code:
n = int(input())
res = 0
while n != 0:
 res = n%10
 dropped = n
 while dropped//10 != 0:
  dropped = dropped//10
  res += dropped%10
 print(res)
 res = 0
 n = int(input())

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == '0':
        break
    print(sum((map(int, s))))

Submission status: Accepted

Solution code:
while True:
    s = raw_input()
    if s == "0":
        break
    print sum([int(i) for i in s])

Submission status: Accepted

Solution code:
while True:
    l = list(input())
    if l == ['0']:
        break
    print(sum(map(int, l)))

Submission status: Accepted

Solution code:
l = list(map(int, input()))
while l[0]:
    print(sum(l))
    l = list(map(int, input()))

Submission status: Accepted

Solution code:
while True:
    n = list(input())
    if n[0] == '0':
        break
    sum = 0
    for i in n:
        sum += int(i)
    print(sum)

Submission status: Accepted

Solution code:
while True:
    n = [int(x) for x in input()]
    if n[0] == 0:
        break
    print(sum(n))

Submission status: Accepted

Solution code:
while True:
	strnum = raw_input().strip()
	if strnum == "0":
		break
	else:
		wa = 0
		for c in strnum:
			wa += int(c)
		print wa