So what would I want to do? I'd like to somehow walk down each of the digits one at a time and add them up. Ah, that's a looping mechanism, right? I need to have some way of walking through them.
去取这个数的,每个数字然后把他们加起来,啊,这是个循环机制对不对?,我得找到一个遍历它们的方法,一种简单的方法可能。
Suppose I take a number. I'd like to add up all the digits inside of the number.
我可以用到刚刚提到的工具,来实现这个功能。
应用推荐