# TODO """ Sum of all digits of _ is _ """ n = int(input()) for n in range(1, n+1): a = int(input()) print("Sum of all digits of", a , "is ", end='') sum = 0 while a > 0: sum = sum + (a % 10) a = a // 10 print(sum)
Category: Python
全新的繁體中文 WordPress 網站
# TODO """ Sum of all digits of _ is _ """ n = int(input()) for n in range(1, n+1): a = int(input()) print("Sum of all digits of", a , "is ", end='') sum = 0 while a > 0: sum = sum + (a % 10) a = a // 10 print(sum)