题解 | #The Biggest Water Problem#
The Biggest Water Problem
http://www.nowcoder.com/practice/435aa556e093463891f6da7d322140a4
思路:
- 设定函数满足题目中的巴拉啦魔法
- while 循环 对数字进行巴拉啦魔法,知道数字是个位数
def mmm(x):
return sum([int(x) for x in str(x)])
x=input()
while len(str(x))>1:
x=mmm(x)
print(x)