n = int(input())
sum = 0
def f(num, sum=0):
sum += num % 10
if num == 0:
print(sum)
else:
f(num // 10, sum)
f(n)
CCF Python题解(100分)201512-1 数位之和
最新推荐文章于 2021-12-30 22:20:01 发布
n = int(input())
sum = 0
def f(num, sum=0):
sum += num % 10
if num == 0:
print(sum)
else:
f(num // 10, sum)
f(n)