未验证 提交 18a4e0c1 编写于 作者: K Keqi Huang 提交者: GitHub

Create 258_ Add_Digits.md

上级 edad408d
### 258. Add Digits
题目:
<https://leetcode.com/problems/add-digits/>
难度:
Easy
思路
这就简单的一p了。。
```python
class Solution(object):
def addDigits(self, num):
"""
:type num: int
:rtype: int
"""
while num / 10 >= 1:
tmp = 0
while num / 10 >= 1:
tmp += num % 10
num /= 10
tmp += num % 10
num = tmp
return num
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册