标签:inf alt 牛顿迭代 ima info span lse turn rgb
思路:
def new_ton(num): if num == 0: return 0 res = int(sqrt(num, num)) print(res) def sqrt(n, x): cur = (n + x/n) / 2 if cur == n: return cur else: return sqrt(cur, x) if __name__ == ‘__main__‘: new_ton(12)
标签:inf alt 牛顿迭代 ima info span lse turn rgb
原文地址:https://www.cnblogs.com/demo-deng/p/14698527.html