摘要: 自己写的: class Solution: def isHappy(self, n: int) -> bool: n_temp = n # 用n_temp保存当前的数字,以便迭代过程中使用 count = 0 # 用于计数,避免无限循环,设定最多迭代10次 while count < 10: # 最 阅读全文
posted @ 2024-03-07 15:36 Junior_bond 阅读(20) 评论(0) 推荐(0)