#害死人不偿命的(3n+1)猜想 n = int(input()) #输入一个正整数n m = 0 # m为砍的次数 while n != 1: if n % 2 == 0: n = n / 2 m +=1 else: n = (3 * n + 1) / 2 m +=1 print(m) ** Python3编写 **