python 递归

def hexes_to_udaciousness(n, spread, target):
    if n >= target:
        return 0
    else:
        return 1 + hexes_to_udaciousness(n+n*spread, spread, target)

 

posted @ 2018-05-17 17:17  卷积  阅读(133)  评论(0编辑  收藏  举报