BC87 数位之和

思路:

step1:按位添加;

代码如下:

n = input()
c = 0
for i in n:
    c += int(i) 
print(c)