Math258AddDigits

来源:互联网 发布:js select case when 编辑:程序博客网 时间:2024/06/05 18:48

思路

  • First use loops to calculate. Has some flaws
  • Then read the wiki “digital roots’, but still remember an special case
    • when n == 9 or n == 18

Flaws

  • The condition of the while loop takes some time to figure it out. Finally I did it.
  • *
0 0
原创粉丝点击